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

再输入密码即可登录。

 

 安装成功!

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM