外部的Navicat连接docker中的mysql

登录mysql执行依次执行:

1.update user set authentication_string = password('11111') where user = 'root';

11111是一开始登录的时候设置的密码

2. alter user 'root'@'%' identified by '11111' password expire never;

3.alter user 'root'@'%' identified with mysql_native_password by '11111';


mysql> update user set authentication_string = password('11111') where user = 'root';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('11111') where user = 'root'' at line 1
mysql> update user set authentication_string='11111' where user = 'root'
    -> ;
Query OK, 2 rows affected (0.08 sec)
Rows matched: 2  Changed: 2  Warnings: 0

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'root' WITH GRANT OPTION' at line 1
mysql> alter user 'root'@'%' identified by '11111' password expire never;
Query OK, 0 rows affected (0.07 sec)

mysql>  alter user 'root'@'%' identified with mysql_native_password by '11111'
    -> ;
Query OK, 0 rows affected (0.06 sec)

希望对你有所帮助

扫描二维码关注公众号,回复: 8584357 查看本文章
发布了356 篇原创文章 · 获赞 147 · 访问量 76万+

猜你喜欢

转载自blog.csdn.net/datouniao1/article/details/103293338