mysql修改密码、创建用户、开放远程

创建密码:

MariaDB [(none)]> use mysql;

MariaDB [mysql]> UPDATE user SET password=password('newpassword') WHERE user='root';

MariaDB [mysql]> flush privileges;

MariaDB [mysql]> exit;

创建用户:

CREATE USER 'username'@'host' IDENTIFIED BY 'password';

开放远程:

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

flush privileges;

你可能感兴趣的:(mysql修改密码、创建用户、开放远程)