Problem Cron Cpanel Reboot Mysql service Maria DB
Hi,
I am encountering a problem with the Cron job in cPanel with this script: `/usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1`.
Every 2.25 hours, this command is executed and the MySQL service is immediately restarted. This is the error I find in the log:
```
[Warning] Access denied for user 'Cpanel::MysqlUtils::Unprivileged'@'localhost' (using password: NO)
```
I have already tried changing the root password but it does not work.
I have added:
```
[mysqld]
skip-name-resolve
```
in `/etc/my.cnf`.
I have tried:
```sql
CREATE USER 'Cpanel::MysqlUtils::Unprivileged'@'localhost' IDENTIFIED BY 'your_password';
GRANT SELECT ON *.* TO 'Cpanel::MysqlUtils::Unprivileged'@'localhost';
FLUSH PRIVILEGES;
```
I have tried:
```
[mysqld]
default_authentication_plugin=mysql_native_password
validate_password.policy=LOW
validate_password.length=6
```
I have tried:
```sh
sudo chmod 600 /root/.my.cnf
```
I have checked in `/root/.my.cnf`, the root password is present.
I have tried:
```sh
mysql -u root -p
```
with the root password, and it connects to the MySQL MariaDB.
I am seeking a resolution to the problem to avoid restarting the database every 2.25 hours.
Thank you.
Best regards,
Alessandro
-
Hey there! They mysqluserstore cron just ensures that cPanel itself can connect to MySQL and doesn't have the ability to restart the service. You can see the following command explaining the function inside the file:
# mysqluserstore used to generate /var/cpanel/databases/users.db but we stopped
# using it so its sole remaining function is to ensure we can connect to mysql
# and reset the password if neededI would recommend undoing the previous changes to the system before performing any additional tests, and then confirm if you are able to access the MySQL command line by simply typing "mysql" on the command prompt. If not, did you receive any errors from the password reset tool in WHM?
0 -
no errors when Change Database Root Password everything was successful.
If I type "mysql" into SSH the database opens correctly
the problem if this cron "`/usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1`" is part my database restarts.
Every 2.25 hours it restarts, this is an anomaly that I have to resolve, only you can help me.0 -
Thanks for the additional details. When the issue happens, the only warning you see is the "[Warning] Access denied for user 'Cpanel::MysqlUtils::Unprivileged'@'localhost' (using password: NO)" correct?
If you disable that cron in root's crontab, do the errors and restarts stop happening?
0 -
these are the messages:
2024-06-10 16:25:01 0 [Note] /usr/sbin/mariadbd (initiated by: unknown): Normal shutdown
2024-06-10 16:25:01 0 [Note] InnoDB: FTS optimize thread exiting.
2024-06-10 16:25:02 0 [Note] InnoDB: Starting shutdown...
2024-06-10 16:25:02 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2024-06-10 16:25:02 0 [Note] InnoDB: Buffer pool(s) dump completed at 240610 16:25:02
2024-06-10 16:25:09 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2024-06-10 16:25:09 0 [Note] InnoDB: Shutdown completed; log sequence number 3337173962382; transaction id 3481015466
2024-06-10 16:25:09 0 [Note] /usr/sbin/mariadbd: Shutdown complete2024-06-10 16:25:11 0 [Note] Starting MariaDB 10.6.18-MariaDB-log source revision 887bb3f73555ff8a50138a580ca8308b9b5c069c as process 622799
2024-06-10 16:25:11 0 [Note] Using unique option prefix 'myisam-recover' is error-prone and can break in the future. Please use the full name 'myisam-recover-options' instead.
2024-06-10 16:25:11 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-06-10 16:25:11 0 [Note] InnoDB: Number of pools: 1
2024-06-10 16:25:11 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-06-10 16:25:11 0 [Note] InnoDB: Using Linux native AIO
2024-06-10 16:25:11 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456000, chunk size = 134217728
2024-06-10 16:25:12 0 [Note] InnoDB: Completed initialization of buffer pool
2024-06-10 16:25:13 0 [Note] InnoDB: 128 rollback segments are active.
2024-06-10 16:25:13 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-06-10 16:25:13 0 [Note] InnoDB: Setting file './ibtmp1' size to 64 MB. Physically writing the file full; Please wait ...
2024-06-10 16:25:13 0 [Note] InnoDB: File './ibtmp1' size is now 64 MB.
2024-06-10 16:25:13 0 [Note] InnoDB: 10.6.18 started; log sequence number 3337173962382; transaction id 3481015466
2024-06-10 16:25:13 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-06-10 16:25:13 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2024-06-10 16:25:13 0 [Note] Plugin 'unix_socket' is disabled.
2024-06-10 16:25:13 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
2024-06-10 16:25:13 0 [Warning] 'innodb-thread-concurrency' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
2024-06-10 16:25:13 0 [Warning] 'innodb-log-files-in-group' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
2024-06-10 16:25:13 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2024-06-10 16:25:13 0 [Note] Server socket created on IP: '127.0.0.1'.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'otticasara@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando_oc34@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'mioserver_oc4@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'mioserver_oc4_test@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando_oc33@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando_oc35@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando_test-oc3b@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'wwwlentiacontatt@142-132-149-138.cprapid.com' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'wwwlentiacontatt__oc33@142-132-149-138.cprapid.com' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'wwwlentiacontatt__oc33@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'wwwlentiacontatt@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'alessandroorg@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'otticasara_wp1@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'mioserver_test-oc3c@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'alessandroorg_oc32@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'wwwlentiacontatt_oc34@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'wwwlentiacontatt_oc34@142-132-149-138.cprapid.com' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'mioserver_test-oc3@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando_oc36@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'cpses_wwbi3bbh8k@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando_test-oc3@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'cpses_wwpqgugd2g@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando_oc32@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando_oc37@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'user' entry 'frocchialando_oc2@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_oc34 frocchialando@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_test-oc3b frocchialando@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_test-oc3 cpses_wwpqgugd2g@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_oc34 frocchialando_oc34@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_test-oc3b frocchialando_test-oc3b@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_oc4 cpses_wwpqgugd2g@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_test-oc3c cpses_wwbi3bbh8k@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_oc36 frocchialando@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'otticasara\_wp1 otticasara_wp1@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_test-oc3c cpses_wwpqgugd2g@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_test-oc3 frocchialando_test-oc3@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_test-oc3\_backup cpses_wwpqgugd2g@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_oc4\_test mioserver_oc4_test@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_oc4 mioserver_oc4@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'wwwlentiacontatt\_oc33 wwwlentiacontatt@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'wwwlentiacontatt\_oc33 wwwlentiacontatt@142-132-149-138.cprapid.com' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'wwwlentiacontatt\_oc34 wwwlentiacontatt@142-132-149-138.cprapid.com' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'wwwlentiacontatt\_oc34 wwwlentiacontatt_oc34@142-132-149-138.cprapid.com' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_oc4\_test cpses_wwpqgugd2g@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'otticasara\_wp1 otticasara@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_test-oc3\_backup cpses_wwbi3bbh8k@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_test-oc3 cpses_wwbi3bbh8k@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_oc4\_test cpses_wwbi3bbh8k@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_oc4 cpses_wwbi3bbh8k@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_oc36 frocchialando_oc36@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_oc35 frocchialando_oc35@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'wwwlentiacontatt\_oc33 wwwlentiacontatt__oc33@142-132-149-138.cprapid.com' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'wwwlentiacontatt\_oc34 wwwlentiacontatt_oc34@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'wwwlentiacontatt\_oc33 wwwlentiacontatt__oc33@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'wwwlentiacontatt\_oc34 wwwlentiacontatt@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_oc35 frocchialando@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'alessandroorg\_oc32 alessandroorg_oc32@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_test-oc3 mioserver_test-oc3@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'mioserver\_test-oc3c mioserver_test-oc3c@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_test-oc3 frocchialando@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_oc2 frocchialando@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'db' entry 'frocchialando\_oc2 frocchialando_oc2@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Warning] 'proxies_priv' entry '@% root@mioserver.it' ignored in --skip-name-resolve mode.
2024-06-10 16:25:13 0 [Note] /usr/sbin/mariadbd: ready for connections.
Version: '10.6.18-MariaDB-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
2024-06-10 16:25:13 3 [Warning] Access denied for user 'Cpanel::MysqlUtils::Unprivileged'@'localhost' (using password: NO)
2024-06-10 16:25:55 0 [Note] InnoDB: Buffer pool(s) load completed at 240610 16:25:55
2024-06-10 16:30:01 3598 [Warning] Access denied for user 'Cpanel::MysqlUtils::Unprivileged'@'localhost' (using password: NO)0 -
All of that looks normal to me except the warning from the process. Can you try disabling that cron to see if that changes the behavior?
0 -
I disabled cron and now mysql is no longer restarted, the problem with the restart is the script.
Can you report it or tell me how to resolve this warning?#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - bin/mysqluserstore Copyright 2022 cPanel, L.L.C.
# All rights reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibiteduse strict;
use warnings;use Cpanel::MysqlUtils::Connect ();
use Try::Tiny;local $SIG{'ALRM'} = sub { die "$0: Timed out" };
# Timeout after 10 minutes
alarm(600);# mysqluserstore used to generate /var/cpanel/databases/users.db but we stopped
# using it so its sole remaining function is to ensure we can connect to mysql
# and reset the password if needed
try {
Cpanel::MysqlUtils::Connect::get_dbi_handle();
}
catch {
#
# We used to do this during restartsrv however that turned out to be
# a problem because check_mysql_password_works_or_reset can restart
# mysql if the password is wrong. This script is run every few hours
# so we check it here now instead.
#require Cpanel::MysqlUtils::Check;
Cpanel::MysqlUtils::Check::check_mysql_password_works_or_reset() or exit(1);
};# This used to happen during a restartsrv check, however this could
# result in a loop because the mysql connection is closed during
# the restart which holds up the restart from completing because
# of a read loop on the socket. The check has been moved here instead
# in order to work around this race condition.
require Cpanel::MysqlUtils::MyCnf::Adjust;
Cpanel::MysqlUtils::MyCnf::Adjust::auto_adjust();exit(0);
0 -
Could you submit a ticket so the server can be investigated? There's no way to suppress the warning message in the log, but I still wouldn't expect this tool to cause any type of restart or interruption to the service.
0 -
should I send it from my Hetzner provaider?
I assure you 100% that the newly launched script restarts Mysql database
0 -
Yes, if your license is purchased through them, they would be your contact for support.
0
Please sign in to leave a comment.
Comments
9 comments