deepin15.11安装MySQL

1.安装

这里我们使用apt方式直接安装

sudo apt-get install -y mysql-server mysql-client

 

2.设置密码

打开终端输入以下命令:

sudo mysql -uroot -p

要求输入密码是直接按回车可以直接进入(sudo必须加,不加进不去)。

如下图:

成功进入命令行模式以后依次执行下面命令设置密码

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;

执行情况如下图:

 

 

 

3.测试 

然后测试root账户能否使用密码正常登录,输入以下命令

mysql -uroot -p

再输入密码即可登录。

 

 安装成功!

 

posted @ 2019-09-06 15:57  LCode丶  阅读(10008)  评论(0编辑  收藏  举报