Centos7 在线安装 Mysql5.7

  1. Install MySQL and the MySQL community server, and start the MySQL service:

    yum localinstall \
    https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
    
    yum install mysql-community-server
    
    systemctl start mysqld.service
    
  2. Obtain the randomly generated MySQL root password.

    grep 'A temporary password is generated for root@localhost' \
    /var/log/mysqld.log |tail -1
    
  3. Reset the MySQL root password. Enter the following command. You are prompted for the password you obtained in the previous step. MySQL then asks you to change the password.

    /usr/bin/mysql_secure_installation
    
    grant all privileges on *.* to root@'%' identified by 'xxxxxxx' with grant option;
    flush privileges;
    mysql -uroot -p
    
posted @ 2019-04-17 09:09  ytsee  阅读(48)  评论(0)    收藏  举报