mysql8的一些命令

//使用用户
USE mysql;
//更改加密规则和密码
ALTER USER 'root'@'145.117.179.148' IDENTIFIED WITH mysql_native_password BY '7S1W3E~qum';
//创建新用户
CREATE USER 'root'@'145.117.179.148' IDENTIFIED BY 'd/3_n5U4~d@U';
//更改用户IP限制为只有145.117.179.148能登录
UPDATE USER SET HOST='localhost' WHERE USER='root' AND HOST='145.117.179.148';
//更改用户IP限制为所有IP都能登录
UPDATE USER SET HOST='localhost' WHERE USER='root' AND HOST='%';
//赋予用户所有权限
GRANT ALL PRIVILEGES ON *.* TO root@'localhost' WITH GRANT OPTION;

你可能感兴趣的:(MySQL)