error establishing a database connection after upgrade mysql to MariaDB

charliecres

Active Member
Mar 5, 2020
27
2
3
Dhaka
cPanel Access Level
Root Administrator
Last Night I upgraded MySQL to MariaDB 10.5. Currently, i am using cloudlinux.


Now I am facing an error issue" error establishing a database connection"|

after per 10-20 minutes it's getting this error for 1-2 minutes. I have tried to fix this. but unable to fix this issue.

so need help to fix this error.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,731
1,864
363
cPanel Access Level
Root Administrator
Hey there! Do you see any additional logs in the MySQL error log at the time this happens? Can you also confirm your credentials work manually on the command line of the server for that user? You can check this with this command:

Code:
mysql -u database_username -p
and then it will prompt for that user's password. If that connects, you can be sure your credentials are good.
 

charliecres

Active Member
Mar 5, 2020
27
2
3
Dhaka
cPanel Access Level
Root Administrator
Hey there! Do you see any additional logs in the MySQL error log at the time this happens? Can you also confirm your credentials work manually on the command line of the server for that user? You can check this with this command:

Code:
mysql -u database_username -p
and then it will prompt for that user's password. If that connects, you can be sure your credentials are good.
more than 100+ websites hosted on this server. everyone is facing this issue. everyone facing this issue suddenly for 2-3 minutes. after that site start working again. but after some time same facing the same issue. still happening this issue.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,731
1,864
363
cPanel Access Level
Root Administrator
Thanks for that clarification - from the way the original post was worded I thought this was only one site having a problem.

Can you check the MySQL error log to see if there is anything helpful shown during the time when the issue happens?
 

charliecres

Active Member
Mar 5, 2020
27
2
3
Dhaka
cPanel Access Level
Root Administrator
Thanks for that clarification - from the way the original post was worded I thought this was only one site having a problem.

Can you check the MySQL error log to see if there is anything helpful shown during the time when the issue happens?
2022-07-21 19:37:46 0 [Note] /usr/sbin/mysqld (initiated by: unknown): Normal shutdown
2022-07-21 19:37:46 0 [Note] Event Scheduler: Purging the queue. 0 events
2022-07-21 19:37:46 0 [Note] InnoDB: FTS optimize thread exiting.
2022-07-21 19:37:47 0 [Note] InnoDB: Starting shutdown...
2022-07-21 19:37:47 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-07-21 19:37:47 0 [Note] InnoDB: Instance 0, restricted to 2048 pages due to innodb_buf_pool_dump_pct=25
2022-07-21 19:37:47 0 [Note] InnoDB: Buffer pool(s) dump completed at 220721 19:37:47
2022-07-21 19:37:48 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2022-07-21 19:37:48 0 [Note] InnoDB: Shutdown completed; log sequence number 74085465729; transaction id 58854579
2022-07-21 19:37:49 0 [Note] /usr/sbin/mysqld: Shutdown complete

2022-07-21 19:37:49 0 [Note] InnoDB: Using Linux native AIO
2022-07-21 19:37:49 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-07-21 19:37:49 0 [Note] InnoDB: Uses event mutexes
2022-07-21 19:37:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2022-07-21 19:37:49 0 [Note] InnoDB: Number of pools: 1
2022-07-21 19:37:49 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-07-21 19:37:49 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2022-07-21 19:37:49 0 [Note] InnoDB: Completed initialization of buffer pool
2022-07-21 19:37:49 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority($
2022-07-21 19:37:49 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-07-21 19:37:49 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-07-21 19:37:49 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-07-21 19:37:49 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-07-21 19:37:49 0 [Note] InnoDB: Waiting for purge to start
2022-07-21 19:37:49 0 [Note] InnoDB: 10.3.35 started; log sequence number 74085465729; transaction id 58854555
2022-07-21 19:37:49 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-07-21 19:37:49 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-07-21 19:37:49 0 [Note] InnoDB: Buffer pool(s) load completed at 220721 19:37:49
2022-07-21 19:37:49 0 [Note] Server socket created on IP: '127.0.0.1'.
2022-07-21 19:37:49 0 [Note] Reading of all Master_info entries succeeded
2022-07-21 19:37:49 0 [Note] Added new Master_info '' to hash table
2022-07-21 19:37:49 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.35-MariaDB-cll-lve' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server

here is last error log ,when last time automatic shut down MariaDB server.

now how can i fix this issue?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,731
1,864
363
cPanel Access Level
Root Administrator
Thanks for providing that output. That all looks normal to me - is there anything else before the "Normal Shutdown" entry at the top of that log? that particular section doesn't give us enough information to tell us what the problem may be.

Are you noticing MySQL having a high load before that shutdown? If so, and if you're able to see it in real-time, if would be a good idea to run this command on the server:

Code:
mysqladmin proc status
as that will show you everything MySQL is doing.
 

charliecres

Active Member
Mar 5, 2020
27
2
3
Dhaka
cPanel Access Level
Root Administrator
Thanks for providing that output. That all looks normal to me - is there anything else before the "Normal Shutdown" entry at the top of that log? that particular section doesn't give us enough information to tell us what the problem may be.

Are you noticing MySQL having a high load before that shutdown? If so, and if you're able to see it in real-time, if would be a good idea to run this command on the server:

Code:
mysqladmin proc status
as that will show you everything MySQL is doing.
Uptime: 19096 Threads: 157 Questions: 4693373 Slow queries: 1276 Opens: 91325 Flush tables: 1 Open tables: 2000 Queries per second avg: 245.777
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,731
1,864
363
cPanel Access Level
Root Administrator
I don't think the output from right now will help us. What I meant was if you were able to catch the problem in real-time, running that command could be helpful to see what is happening on the machine. It isn't going to tell us much when things are working well.

You may need to work with a database administrator to fix this problem by having that person monitor the server during the time the issue happens and see what is causing the behavior.
 

charliecres

Active Member
Mar 5, 2020
27
2
3
Dhaka
cPanel Access Level
Root Administrator
i have found the problem. one of my user has enabled free reg for his site. suddenly auto registration started he got 100k+ reg within 1 day.100k+ post,, and more..