当前位置: 移动技术网 > IT编程>数据库>Mysql > Linux系统下安装mysql时出现1045,1130错误的解决办法

Linux系统下安装mysql时出现1045,1130错误的解决办法

2018年12月26日  | 移动技术网IT编程  | 我要评论

环境 centos6.8 软件 mysql5.7.22

首先查询中是否是否有mysql

rpm -qa|grep mysql

yum -y remove 粘贴查询出来的文件

mysql安装完成登录时报1045,解决办法

1、打开etc目录下my.cnf文件

vi /etc/my.cnf [mysqld] 下加 skip-grant-tables

2、重启mysql服务

service mysqld restart

3、进入mysql修改密码

mysql -u root -p 回车 输入密码

>use mysql;

>update user set authentication_string=password('密码') where user='root';密码尽量要复杂,不然后面还有修改密码;

>flush privileges;

>quit;

4、删除 skip-grant-tables ,重启mysql服务

远程连接mysql服务时报1130,需要权限

1、进入mysql

mysql -u root -p 回车 输入密码

>use mysql;

>grant all privileges on *.* to 'root'@'x.x.x.x' identified by '密码';

>grant all privileges on *.* to 'root'@'x.x.x.x' identified by '密码' with grant option;

>flush privileges;

2、在远程连接过程中出现10060错误,需关闭系统防火墙

service iptables status

service iptables stop

chkconfig iptables off 永久关闭服务

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网