This is an article where the main focus is just to solve the error message exist in the title of this article. The error itself is “The server quit without updating PID file (/opt/mysql/temp/mysql-5.7.28-linux-glibc2.12-x86_64/data/mysqld57-1.pid)”. Basically, this is happening because of the attempt for installing MySQL Database Server manually. The following are the steps for installing MySQL Database Server manually :
1. Download the compressed file source installer of MySQL Database Server. For an example, just download it from a page exist in this link. There are lots of files exist according to the version of the operating system and architecture available for further download. In this context, the file is ‘mysql-5.7.28-linux-glibc2.12-x86_64.tar.gz’.
2.Extract the file mentioned above and place it into the chosen location. For an example, in this context it will be in ‘/opt/mysql/temp/mysql-5.7.28-linux-glibc2.12-x86_64’.
3. Create an init file from an existing template. It is in the folder of ‘/opt/mysql/temp/mysql-5.7.28-linux-glibc2.12-x86_64/support-files’ with the file name of ‘mysql.server’. Just copy it into ‘/etc/init.d/’ folder location.
4. Create a MySQL Configuration file. Just create it in the same folder of the MySQL Database Server source installer. For an example, create the file ‘my.cnf’ in ‘/opt/mysql/temp/mysql-5.7.28-linux-glibc2.12-x86_64’.
5. Start the service of MySQL Database Server by executing the following command in the command line interface :
service mysqld57 start
Just as in the above pattern, the ‘mysqld57’ is just the name of the file exist from the result of copy process in the third step. By copying ‘mysql.server’ file into the /etc/init.d/ folder location, just select any file name for an easy identification. In this context, it is ‘mysqld57’ to indicate it is a service of MySQL Database Server with the version of ‘5.7’.
Continuing on the last step above, apparently the service doesn’t start at all. The error appear is as it exist in the title of this article. There is a long message appear upon executing the ‘journalctl -xe’ command as follows :
-- A start job for unit mysqld57-1.service has begun execution. -- -- The job identifier is 38990. Jan 03 08:03:08 hostname mysqld57: Starting MySQL Jan 03 08:03:14 hostname mysqld57: ..... * The server quit without updating PID file (/opt/mysql/temp/mysql-5.7.28-linux-glibc2.12-x86_64/data/mysqld57-1.pid). Jan 03 08:03:14 hostname systemd: mysqld57-1.service: Control process exited, code=exited, status=1/FAILURE -- Subject: Unit process exited -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- An ExecStart= process belonging to unit mysqld57.service has exited.
Apparently, after checking the error message further, there is an information about how to solve the problem. The error message exist in /opt/mysql/temp/mysql-5.7.28-linux-glibc2.12-x86_64. It is actually a definition exist in MySQL Database Server’s configuration file. The definition exist in the following line :
[mysqld] ... log-error=/opt/mysql/temp/mysql-5.7.28-linux-glibc2.12-x86_64/log/mysqld.error.log
In the error message, there is an information Apparently, after checking the error message further, there is an information about how to solve the problem. The error message exist in /opt/mysql/temp/mysql-5.7.28-linux-glibc2.12-x86_64/log/mysqld.error.log as follows :
2020-01-03T01:03:11.654509Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 2020-01-03T01:03:11.654547Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files. 2020-01-03T01:03:11.654747Z 0 [ERROR] Aborting
Analyzing the error above, mysql database, especially the ‘user’ table does not exist. So, in order to start MySQL Database Server properly, the ‘datadir’ definition in the MySQL Database Server’s configuration must be false. In the case of this article, correcting the entry or the value of ‘datadir’ definition will start the MySQL Database Server for the first time. After changing the datadir where ‘mysql’ table exist, MySQL Databse Servers