你的位置: Kiyo'Space首页 数据库 阅读文章 欢迎留下您的足迹

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;


欢迎在此留下您的脚步






评论内容 (*必填):
(Ctrl + Enter 快速提交)