1、添加用户server,密码为123456
GRANT USAGE ON *.* TO 'server'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
2、将权限赋予用户server
grant all privileges on *.* to 'server'@'%' IDENTIFIED BY '123456';
3、使修改生效
flush privileges;
4、修改用户密码
#修改root密码为123456
mysqladmin -u root -p password 123456
#以下方式必须是先用root帐户登入mysql,然后执行:
UPDATE user SET password=PASSWORD('123456') WHERE user='root';
FLUSH PRIVILEGES;
原创内容转载请保留出处GEEK笔记(http://www.geekapp.cn/)。