设置允许计算机登录mysql服务器
mysql
M2d59ef9fe
允许任意计算机登录mysql服务器:GRANT ALL PRIVILEGES ON . TO ‘root‘@’%’ IDENTIFIED BY ‘root’ WITH GRANT OPTION;
1 | mysql -uroot -p |
添加用户
以root用户登录数据库,运行以下命令:
1 | create user yzht identified by 'Yzht8888-%$#'; |
查看用户
1 | select User, Host, Password from mysql.user; |

授权
命令格式:grant privilegesCode on dbName.tableName to username@host identified by “password”;
1 | grant all privileges on yzht.* to yzht@'%' identified by 'Yzht8888-%$#'; |