第一部分:安裝Mysql5.7 1.下載YUM庫 shell > wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm 2.安裝YUM庫 shell > yum localinstall -y mysql57 ...
第一部分:安裝Mysql5.7
1.下載YUM庫
shell > wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm 2.安裝YUM庫 shell > yum localinstall -y mysql57-community-release-el7-7.noarch.rpm 3.安裝資料庫 shell > yum install -y mysql-community-server4.啟動MySQL服務
shell > systemctl start mysqld.service
5.預設空密碼
shell > mysql -uroot -p
6.重置root密碼後重啟mysql服務
shell > update mysql.user set authentication_string=password("yourpassword") where user="root" and Host="localhost";
shell > flush privileges;
shell > quit;
shell > systemctl restart mysqld;
如果手賤或者不知道啥原因出現如下問題:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
請修改my.cnf,添加skip-grant-tables和skip-networking:
shell > vi /etc/my.cnf
[mysqld]
skip-grant-tables
skip-networking
重啟mysql,然後重覆以上修改密碼步驟即可,記得修改完後,去掉my.cnf添加的兩行。