MySQL数据库几个常用操作

mysql>SET PASSWORD FOR  'some_user'@'some_host' = OLD_PASSWORD('newpwd');
mysql>FLUSH PRIVILEGES;

mysql>Update mysql.user SET Password = OLD_PASSWORD('newpwd') Where Host = 'some_host' AND User='some_user';
mysql> FLUSH PRIVILEGES;

添加mysql的user_db用户,用于操作user_db数据库

create database user_db;
grant all on user_name.* to user_db@localhost identified by "user_pass";

添加远程主机连接MySQL

GRANT ALL PRIVILEGES ON user_name.* TO 'user_db'@'%' IDENTIFIED BY 'user_pass' WITH GRANT OPTION;
GRANT Select,Update,Insert,Delete ON user_name.* TO 'user_db'@'127.0.0.1' IDENTIFIED BY 'user_pass' WITH GRANT OPTION;

版权声明:
作者:Kiyo
链接:https://www.wkiyo.cn/html/2008-01/i310.html
来源:Kiyo's space
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>