mysql - 某些新安装的版本设置初始化密码

访问量: 40

1. 使用secure install ,  我的不行

2. 用这个方法: 参考 https://askubuntu.com/a/1110137/52678

mysql> show databases;

mysql> use mysql;

mysql> update user set authentication_string=PASSWORD("new_password") where user='root';

mysql> update user set plugin="mysql_native_password";

mysql> flush privileges;

mysql> quit;

或者使用这个方法:(参考: https://stackoverflow.com/a/52674808/445908

sudo mysql -u root

Then create a normal user, set a password, then use that user to work.

create user 'user'@'localhost' identified by 'user1234';
grant all on your_database.* to 'user'@'localhost';
select host, user from mysql.user;

Then try to access:

mysql -u user -puser1234

订阅/RSS Feed

Subscribe

分类/category