安装 MySQL
sudo apt-get install -y mysql-server mysql-client
设置登录账户信息
update mysql.user set plugin="mysql_native_password" where user="root";
grant all on *.* to root@"localhost";
update mysql.user set authentication_string=password('密码') where user='root'and Host = 'localhost';
flush privileges;
测试登录
mysql -uroot -p
网友评论