Solution to the error reported by Mysql systemctl start mysqld

Solution to the error reported by Mysql systemctl start mysqld

Error message:

Job for mysqld.service failed because the control process exited with error code. See “systemctl status mysqld.service” and “journalctl -xe” for details.

insert image description here

Positioning error:

vim /var/log/mysqld.log #View log information

See the last line (shift+G)

insert image description here

Cause Analysis:

The MySQL data storage location was changed to the data disk address, the machine was restarted, and the disk mount was not set to automatically mount at startup, resulting in the PID file not being found.

Solution: 1. Check the location of pid-file in /etc/my.cnf

vim /etc/my.cnf 

2. Create the corresponding directory and modify the permissions

mkdir -p /var/run/mysqld
chown mysql.mysql /var/run/mysqld

Now you can try to restart MySQL. If it can start, then it is ok. If it still doesn’t work, continue to step 3.

3. Create a pid file and modify permissions

touch /var/run/mysql/mysqld.pid
chown mysql.mysql /var/run/mysql/mysqld.pid

There should be no problem starting MySQL again!

This is only a temporary solution. If the virtual machine is restarted, the operation will need to be repeated. There is no solution to the fundamental problem yet, so please suspend the virtual machine temporarily. The article will be updated when a solution is found later!

This is the end of this article about solving the problem of Mysql systemctl start mysqld error. For more related content about solving the problem of Mysql systemctl start mysqld error, please search the previous articles of 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to solve the error when connecting to MySQL in Linux: Access denied for user 'root'@'localhost'(using password: YES)
  • MySQL login error prompt: Solution to ERROR 1045 (28000)
  • MySQL error: Deadlock found when trying to get lock; try restarting transaction solution
  • MySQL startup error: File ./mysql-bin.index not found (Errcode: 13)
  • mysql error This function has none of DETERMINISTIC solution
  • Solution to MySql error "Table mysql.plugin doesn't exist"
  • MySQL error: MySQL server version for the right syntax to use near type=InnoDB solution
  • MySQL Error 1290 (HY000) Solution
  • MySQL cannot restart and reports the error Warning: World-writable config file '/etc/my.cnf' is ignored. Solution

<<:  What should I do if I can't view the source file of a web page?

>>:  Discussion on style customization and browser compatibility issues when using input element [type="file"]

Recommend

Navicat connection MySQL error description analysis

Table of contents environment Virtual Machine Ver...

Analysis of implicit bug in concurrent replication of MySQL 5.7

Preface Most of our MySQL online environments use...

Solution to MySQL 8.0 cannot start 3534

MySQL 8.0 service cannot be started Recently enco...

Pure CSS drop-down menu

Achieve results Implementation Code html <div ...

Packetdrill's concise user guide

1. Packetdrill compilation and installation Sourc...

How to build a new image based on an existing image in Docker

Building new images from existing images is done ...

WeChat applet + ECharts to achieve dynamic refresh process record

Preface Recently I encountered a requirement, whi...

Specific use of CSS front-end page rendering optimization attribute will-change

Preface When scroll events such as scroll and res...

CSS isolation issue in Blazor

1. Environment VS 2019 16.9.0 Preview 1.0 .NET SD...

MySQL configuration SSL master-slave replication

MySQL5.6 How to create SSL files Official documen...

Vue parent component calls child component function implementation

Vue parent component calls the function of the ch...

vue+rem custom carousel effect

The implementation of custom carousel chart using...

Trash-Cli: Command-line Recycle Bin Tool on Linux

I believe everyone is familiar with the trashcan,...