MySQL won't start after reboot but...

frenziedfox

Member
Mar 9, 2010
21
2
53
...it does start if you restart the service in WHM. All the tables are healthy in 'mysqlcheck'. If you do 'service mysql status' it comes back:

ERROR! MariaDB is running but PID file could not be found
It's running MariaDB 10.3 (upgraded through cPanel)

I have a '/var/lib/<hostname>.pid' file but it seems the server won't see it.

What should I try?

thanks,

Alex


/var/lib/mysql/<hostname>.err after a WHM restart
2020-03-25 14:10:14 0 [Note] InnoDB: Using Linux native AIO
2020-03-25 14:10:14 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-03-25 14:10:14 0 [Note] InnoDB: Uses event mutexes
2020-03-25 14:10:14 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2020-03-25 14:10:14 0 [Note] InnoDB: Number of pools: 1
2020-03-25 14:10:14 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-03-25 14:10:14 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-03-25 14:10:14 0 [Note] InnoDB: Completed initialization of buffer pool
2020-03-25 14:10:14 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-03-25 14:10:14 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-03-25 14:10:14 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-03-25 14:10:14 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-03-25 14:10:14 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-03-25 14:10:14 0 [Note] InnoDB: 10.3.22 started; log sequence number 78038223553; transaction id 87946114
2020-03-25 14:10:14 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-03-25 14:10:14 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-03-25 14:10:15 0 [Note] Server socket created on IP: '::'.
2020-03-25 14:10:15 0 [Note] Reading of all Master_info entries succeeded
2020-03-25 14:10:15 0 [Note] Added new Master_info '' to hash table
2020-03-25 14:10:15 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.22-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
2020-03-25 14:10:15 0 [Note] InnoDB: Buffer pool(s) load completed at 200325 14:10:15
 
Last edited:

frenziedfox

Member
Mar 9, 2010
21
2
53
Ah... I used the wrong command...

'systemctl status mariadb.service'

● mariadb.service - MariaDB 10.3.22 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf, protecthome.conf
Active: active (running) since Wed 2020-03-25 15:12:48 GMT; 14min ago
Docs: man:mysqld(8)
systemd
Main PID: 1724 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─1724 /usr/sbin/mysqld

Mar 25 15:12:47 matthae3.miniserver.com systemd[1]: Starting MariaDB 10.3.22 database server...
Mar 25 15:12:48 matthae3.miniserver.com mysqld[1724]: 2020-03-25 15:12:48 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB) star...24 ...
Mar 25 15:12:48 matthae3.miniserver.com systemd[1]: Started MariaDB 10.3.22 database server.
Hint: Some lines were ellipsized, use -l to show in full.
So I did 'systemctl enable mariadb.service':
Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/mysqld.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
Now it says it's enabled:
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Hopefully that will mean it will come up automatically? I can't test it at the moment... I don't know why it was disabled either...
 
  • Like
Reactions: cPanelLauren

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
10,088
877
313
Houston
Glad to see you were able to find the issue. It should be coming up automatically, is the service monitored in WHM? Monitored services will be restarted when/if they're stopped. You can check currently monitored services here: WHM>>Service Configuration>>Service Manager.