linux下mysql出现的几个小问题

来源:互联网 发布:js随机颜色 编辑:程序博客网 时间:2024/06/01 08:54

今天在linux使用mysql出现的几个问题:

要完成的任务:使用本地管理工具管理服务器上的数据

linux下:

/usr/local/mysql/bin/mysql -uroot -p123456  //进入mysql管理界面

出现错误:

ERROR 1045 (28000):
Access denied for user 'root'@'localhost' (using password: YES) 

解决办法:

/usr/local/mysql/share/mysql/mysql.server stop  //先关闭mysql

/usr/local/mysql/bin/ mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 

/usr/local/mysql/bin/mysql -u root mysql

UPDATE user SET Password=PASSWORD('123456') where USER='root';//修改密码

重启mysql服务

**************************

对本地ip192.168.1.48进行授权:

mysql> grant all on *.* to root@'192.168.1.48' identified by '123456';//授权ip访问权限

********************************************************************

本地使用数据库管理工具:

使用数据库管理工具--连接数据管理数据

报错:error no 2003 can't connect to mysql server on192.168.1.23

我的问题可能是防火墙没有关闭,解决办法两种:

关闭防火墙⑴service iptables stop (临时关闭)

 ⑵chkconfig iptables off (重启生效的)

********连接成功


原创粉丝点击