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';
授予权限
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服务
- 登陆mysql
- 修改密码:
- use mysql;
- update user set authentication_string=password('root') where User='root';
- flush privileges;
- quit
- 或者授权
此处省略1000字 - 删除skip-grant-tables配置
- 重启mysql
网友评论