mysql远程登录(授权与撤销授权)

一、远程登录授权:GRANT
1.登录musql

mysql -u root -p

2.输入密码登陆之后授权:

mysql> GRANT ALL PRIVILEGES ON *.* TO'root'@'%' IDENTIFIED BY 'xxxxxx' WITH GRANT OPTION;

注:XXXXXX为mysql的root账户密码

3.刷新系统权限:

mysql> flush privileges;

二、撤销授权:REVOKE
revoke 跟 grant 的语法差不多,只需要把关键字 “to” 换成 “from” 即可:

grant  all on *.* to   dba@localhost;  
revoke all on *.* from dba@localhost; 

你可能感兴趣的:(mysql)