一. 【apt-get install mysql-server-8.0 】
Here I am using the mirror of CSU, I do not know if it is an old mirror or a new mirror, in short, only the latest mysql-8.0 But mysql-5.7 seems to have problems with Chinese input, you can try other mirrors have 5.7 versions, but I have the fastest speed of this version of the mirror, all tested, not all CSU mirrors are the same fast, not the same. There should be a difference between old and new
二. 【sudo service mysql stop; sudo usermod -d /var/lib/mysql/ mysql ; sudo service mysql start;】
However, after typing mysql, I found the error sock2 Missing file location not found Enter the above command
三 【mysql;use mysql;ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘密码’;FLUSH PRIVILEGES;】
Now you should find that you can go into mysql without entering any password, this is not our goal, we want to set the password, here the settings are the same whether it is mysql 5.7 or 8.0
四 login sqlyog is ok;
蹩脚英语,见笑了。若能看懂 送你们一场造化。