MySQL01
http://www.fedora.hk/linux/fuwu/show_18.html
http://blog.csdn.net/ozwarld/article/details/7056339
UPDATE user SET Password = password('WordPress2010') WHERE User = ’root’ ;
update user set password=PASSWORD(‘123456789asdf’) where User='root';
update user set password=password('123456') where user='root';
初始安装mysql时无密码。在本机可以无密码登陆,但是不可以远程登陆。
set password for root@localhost=password ('123456'); 设置本地登陆密码
set password for root@127.0.0.1=password ('123456'); 设置本地登陆密码
set password for root@localhost.localdomain=password ('123456'); 没有执行成功(是因为我的localhost.localdomain是lubeitt.info)localhost.localdomain是主机名字。
(select user,host,password from mysql.user;可以查看到账户信息)
删除匿名登录账号:
CREATE USER 'root'@'%' IDENTIFIED BY 'Fuckfuck3389';
设置远程访问
mysql>CREATE USER 'root'@'%' IDENTIFIED BY '您的密码'; ← 增加root用户指定可以任意IP登录,如果想限制只能让指定IP登录请把%替换成IP地址
给新添加的root添加权限。
GRANT ALL PRIVILEGES ON * . * TO 'root'@'%' IDENTIFIED BY 'Fuckfuck3389' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
flush privileges; 刷新