下午在测试master/slave mysql service时,master添加一个用户提供给slave以便同步,
GRANT all ON 数据库名.* TO juniper@'192.168.50.112'
IDENTIFIED BY 'juniper';
说明:
(1)grant all 赋予所有的权限
(2)数据库名.* 数据库 gamesp 中所有的表
(3)juniper 用户名
(4)@'192.168.50.112' mysql server
服务器(slave)
(5)identfified by 'juniper' 设置密码
ERROR 1045 (28000): Access denied for
user 'root'@'localhost' (using password: NO)
解决方法:
# /etc/init.d/mysql stop 或者 service mysqld
restart
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking
&
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('密码') where
USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart 或者 service mysqld restart
# mysql -u root -p
Enter password:
----》在(1)中的密码
ok!!!!!!!