首页 > MySQL

MySQL允许远程访问

授权用户远程访问数据库 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;

重置MySQL密码

禁用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 ...

最新文章

最近回复