Msyql fails to be started
Problem description
- Run the following command to log in to service mysqld start
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
Copy the code
- Check the mysql error log
tail -f /var/log/mysqld.log
Copy the code
- The solution
-
The original is a memory allocation problem, the free command to check the memory
-
Configure my.cnf and add the following sentence
innodb_buffer_pool_size = 128M Copy the code
-
Distribution of swap
Dd if=/dev/zero of=/swapfile bs=1M count=1024 mkswap /swapfile swapon /swapfile /swapfile swap swap defaults 0 0 Go to /etc/fstabCopy the code
After the server is restarted, the mysql server is restarted
-