标签:本机 常用命令 mysqldump 授权 host 权限 rev rom revoke
CREATE USER ‘username‘@‘host‘ IDENTIFIED BY ‘password‘;
比如
create user ‘test_user‘@‘%‘ identified by ‘test‘;
ps:如果只允许本机登录则host=localhost,如果允许从任意远程主机登陆则host=%
修改密码
SET PASSWORD FOR ‘username‘@‘host‘ = PASSWORD(‘newpassword‘);
GRANT privileges ON dbname.tablename TO ‘username‘@‘host‘
比如
GRANT ALL ON test_db.* TO ‘test_user‘@‘%‘;
撤销权限
REVOKE privilege ON dbname.tablename FROM ‘username‘@‘host‘;
$ mysqldump -u dbuser -p dbname [tablename] > dump.sql
ps:tablename可选
mysql>source /path/dump.sql
或者
$ mysql -uusername -p dbname < dump.sql
标签:本机 常用命令 mysqldump 授权 host 权限 rev rom revoke
原文地址:https://www.cnblogs.com/barneywill/p/10271024.html