当前位置:网站首页>mysql8.0 ubuntu20.4

mysql8.0 ubuntu20.4

2022-07-07 23:40:00 Melt_


uninstall
 sudo apt purge mysql-*

    sudo rm -rf /etc/mysql/ /var/lib/mysql

    sudo apt autoremove

    sudo apt autoclean
ubuntu install mysql

1.

  sudo apt-get install mysql-server -y

   sudo apt install mysql-client  -y

   sudo apt install libmysqlclient-dev -y

2.check
sudo netstat -tap | grep mysql


3.find user&passwd
sudo cat/etc/mysql/debian.cnf

(2)use client user&passwd 

mysql -udebian-sys-maint -p
passwd:passwd int file debian.cnf

4.change root passwd

ALTER USER 'root'@'localhost' IDENTIFIED BY 'passwd here';

[client]
host     = localhost
user     = debian-sys-maint
password = kKSqZX8vwaOEJOuo
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = kKSqZX8vwaOEJOuo
socket   = /var/run/mysqld/mysqld.sock
 

原网站

版权声明
本文为[Melt_]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130556166693.html