Before Ubuntu20.04 installing MySQL 8.0, ready to sudo mysql
enter, enter the carriage return
ERROR 2002 (HY000):Can't connect to local MySQL server though socket '/var/lib/mysql/mysql.sock'(2)
Looking for a long time is not found, the installation is the command to sudo apt install mysql-server mysql-client
be installed, when a video tutorial chance to learn, to see through the installation steps to install the following commands:
sudo su
sudo apt install mysql-server mysql-client
First enter the root administrator identity, and then install, the administrator must also add it when installing sudo
. So you can enter, and then enter mysql to enter the password modification. The steps for modifying the password are available online, so I won't write so many.
sudo mysql # 进入 mysql 进行修改密码
The specific reason is not known why. I hope someone can comment and tell me.