Solution to the problem that linux mysqld cannot start: 1. Install mysql through the "yum install mysql-server" command; 2. Open "my.cnf", and then add a line "skip-" under "[mysqld]" grant-tables"; 3. Restart mysql through "systemctl restart mysqld".
The operating environment of this tutorial: linux5.9.8 system, mysql version 5.7, DELL G3 computer
What to do if linux mysqld cannot start ?
Common solutions to mysql installation failure and startup failure in Linux
systemctl start mysqld.service
find / -name mysql
Then use yum to install mysql
yum install mysql-server
cat /var/log/mysqld.log | grep 'root@localhost:'
2022-05-13T02:35:13.846556Z 1 [Note] A temporary password is generated for root@localhost: a#sE2lVHzzvV
If the connection is still refused, try skipping the password to enter: enter vim /etc/my.cnf and add a line under [mysqld]skip-grant -tables is used to skip the password verification process, and then restart mysql
systemctl restart mysqld, and then enter the command
mysql to enter. After changing the password, you can remove this line Configure and then reboot.
flush privileges; alter user root@localhost identified by '1234';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
alter user root@localhost identified by 'Han123..' # mysql5.7 ,若失败可以将root@localhost替换root@%试试 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Han123..'; # mysql8.0,若失败可以将'root'@'localhost'替换'root'@'%'试试
The above is the detailed content of What to do if linux mysqld cannot start. For more information, please follow other related articles on the PHP Chinese website!