Directory /var/run/mysqld deleted after server reboot (Graceful Server Reboot)

Operating System & Version
CentOS v7.9.2009
cPanel & WHM Version
v100.0.12

galileuNet

Member
Nov 30, 2021
8
0
1
--
cPanel Access Level
Root Administrator
Hello,
A few motnhs ago I uptaded my server from MySQL 5.7 to MariaDB 10.3. All works great, but when the server reestarts the mysql proces no reestarted (?¿)
After a investigation with a ticket to cpanel for some reason, the directory: /var/run/mysqld did not exists, therefore, it was deleted. (very strange)
I created it and change it to correct ownership and MySQL started without any issues.

After this all works ok, but this issue occurs again and again if the server is rebooted: the /var/run/mysqld it's deleted.
I can't not found what makes this directory delation.
Can anyone help?
 
Last edited by a moderator:

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
476
223
118
IN
cPanel Access Level
Root Administrator
Can you please share the output of:

Code:
#cat /etc/my.cnf
 
  • Like
Reactions: cPRex

galileuNet

Member
Nov 30, 2021
8
0
1
--
cPanel Access Level
Root Administrator
Yes, shure:
--------------------------------------------
# For advice on how to change settings please see
# MySQL :: MySQL 5.7 Reference Manual :: 5.1.2 Server Configuration Defaults

[mysqld]
performance-schema=0
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
innodb_buffer_pool_size=52428800
max_allowed_packet=268435456
open_files_limit=40000
innodb_file_per_table=0
sql_mode=""
-------------------------------
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
476
223
118
IN
cPanel Access Level
Root Administrator
Try commenting pid-file=/var/run/mysqld/mysqld.pid line in your /etc/my.cnf file.

We have a server with MariaDB 10.3 without pid-file=/var/run/mysqld/mysqld.pid line /etc/my.cnf file.
 

quietFinn

Well-Known Member
Feb 4, 2006
1,668
341
438
Finland
cPanel Access Level
Root Administrator
It's not really correct to say that "/var/run/mysqld is deleted after server reboot", because the /var/run/ files and folders are created by the system upon each reboot.
I found this, it might help in this situation:
 

galileuNet

Member
Nov 30, 2021
8
0
1
--
cPanel Access Level
Root Administrator
It's not really correct to say that "/var/run/mysqld is deleted after server reboot", because the /var/run/ files and folders are created by the system upon each reboot.
I found this, it might help in this situation:
Hello quietFinn,
Thsnak for your post.
Yes, I know this it's may not be correct, but it explains my situation. If I create the "/var/run/mysqld" manually, change owner and restart mysql snd it works. But if I reboot the server this directory "disappears". It's all I know
 

quietFinn

Well-Known Member
Feb 4, 2006
1,668
341
438
Finland
cPanel Access Level
Root Administrator
I think the pid file is in /var/lib/mysql/ :rolleyes:
If you try to force it to /var/run/mysqld/ in /etc/my.cnf it fails.
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
476
223
118
IN
cPanel Access Level
Root Administrator