归档 write 编程 财务软件 会计 数据库 网络工程 运维 自考 doc文档系统 管理
 

mysql远程访问

mysql> ALTER USER 'root'@'localhost'
    ->   IDENTIFIED WITH mysql_native_password
    ->   BY 'password';
Query OK, 0 rows affected (0.02 sec)


mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysql';
Query OK, 0 rows affected (0.01 sec)


mysql> use mysql;
Database changed
mysql> select host, user, authentication_string, plugin from user;


mysql> grant all privileges on *.* to 'root'@'%';
ERROR 1410 (42000): You are not allowed to create a user with GRANT
mysql> update user set host='%' where user ='root';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

  

posted @ 2021-03-04 10:23  少时的路  阅读(44)  评论(0编辑  收藏  举报