1.安装mysql

sudo apt-get install mysql-client mysql-server

2.启动

service mysqld start

3.登陆

mysql -uroot

报错Access denied for user 'root'@'localhost'

4.打开/etc/mysql/debian.conf

mysql -udebian-sys-maint -p7muZMj8yEczJkvgi

5.修改密码

update user set plugin='mysql_native_password';

update user set authentication_string=password('123456') where user='root' and host='localhost';

flush privileges;

6.重新登陆

mysql -uroot -p123456

-------------------------------------------------------------------------------------------------------------------------------------- 

删除 mysql

sudo apt-get autoremove --purge mysql-server-5.0
sudo apt-get remove mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get remove mysql-common //这个很重要
上面的其实有一些是多余的。

清理残留数据

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

相关文章:

  • 2021-09-12
  • 2020-04-16
  • 2021-11-21
  • 2021-12-11
  • 2022-01-08
  • 2021-08-24
猜你喜欢
  • 2021-09-29
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
  • 2021-11-03
  • 2021-07-21
  • 2021-12-19
相关资源
相似解决方案