您的位置:首页 > 运维架构 > Linux

linux下mysql出现的几个小问题

2011-09-22 16:25 211 查看
今天在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 (重启生效的)

********连接成功
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐