mysql問題
mysql安裝
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
systemctl start mysqld.service
yum -y remove mysql57-community-release-el7-10.noarch
mysql初始密碼查找
grep "password" /var/log/mysqld.log
修改初始密碼
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
授予權(quán)限
mysql遠程連接
問題:
ERROR 1130 (HY000): Host '223.87.33.93' is not allowed to connect to this MySQL server
解決辦法:
update user set host = '%' where user = 'root';
flush privileges;
忘記密碼處理:
- vim /etc/my.cnf, 在mysqld增加skip-grant-tables
- 重啟mysql服務(wù)
- 登陸mysql
- 修改密碼:
- use mysql;
- update user set authentication_string=password('root') where User='root';
- flush privileges;
- quit
- 或者授權(quán)
此處省略1000字 - 刪除skip-grant-tables配置
- 重啟mysql