- 2017/05/07
- |
- 技术随笔
- |
- 0 Replies
授权用户远程访问数据库
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
授权用户远程访问数据库(带管理权限)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'WITH GRANT OPTION;
FLUSH PRIVILEGES;
取消授权
REVOKE ALL ON *.* FROM 'root'@'%';
FLUSH PRIVILEGES;
- 2017/04/06
- |
- 技术随笔
- |
- 0 Replies
禁用mysql权限表
vi /etc/my.cnf
添加如下一行
skip-grant-tables
重启mysql
service mysql restart
进入mysql修改密码
mysql -u root -p
mysql> USE mysql;
mysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPass') WHERE User = 'root' AND Host = 'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit
...