Problem with Mysql service.

hoangnguyen

Verified User
Joined
May 12, 2013
Messages
8
My VPS is using Directadmin. About 1 week now, it does not operate normally. Always stop the problem happening Mysql service.
The website I have received the message: Cannot connect database.

I do not how to solve the above problems?
Thanks & Best regards,

Hoang Nguyen
 
Does it work again if you restart mysql?
Check the mysql error log (/var/lib/mysql/your.hostname.com.err) for errors.
 
Yes, i restart Mysql service. But it's not good solution.

This is the message in logs:
Code:
130315 08:28:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130315  8:28:35 [Note] Plugin 'FEDERATED' is disabled.
130315  8:28:35 InnoDB: The InnoDB memory heap is disabled
130315  8:28:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130315  8:28:35 InnoDB: Compressed tables use zlib 1.2.3
130315  8:28:35 InnoDB: Using Linux native AIO
130315  8:28:35 InnoDB: Initializing buffer pool, size = 128.0M
130315  8:28:35 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
130315  8:28:35  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
130315  8:28:35  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
130315  8:28:36  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
130315  8:28:36  InnoDB: Waiting for the background threads to start
130315  8:28:37 InnoDB: 1.1.8 started; log sequence number 0
130315  8:28:37 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130315  8:28:37 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130315  8:28:37 [Note] Server socket created on IP: '0.0.0.0'.
130315  8:28:37 [Note] Event Scheduler: Loaded 0 events
130315  8:28:37 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.27'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
130407 23:20:41 mysqld_safe Number of processes running now: 0
130407 23:20:41 mysqld_safe mysqld restarted
130407 23:21:05 [Note] Plugin 'FEDERATED' is disabled.
130407 23:21:06 InnoDB: The InnoDB memory heap is disabled
130407 23:21:06 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130407 23:21:06 InnoDB: Compressed tables use zlib 1.2.3
130407 23:21:06 InnoDB: Using Linux native AIO
130407 23:21:06 InnoDB: Initializing buffer pool, size = 128.0M
130407 23:21:10 InnoDB: Completed initialization of buffer pool
130407 23:21:39 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130407 23:21:56  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130407 23:24:04  InnoDB: Waiting for the background threads to start
130407 23:24:06 InnoDB: 1.1.8 started; log sequence number 366492315
130407 23:24:22 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130407 23:24:22 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130407 23:24:23 [Note] Server socket created on IP: '0.0.0.0'.
130407 23:24:31 [Note] Event Scheduler: Loaded 0 events
130407 23:24:31 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.27'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
130407 23:31:41 mysqld_safe Number of processes running now: 0
130407 23:31:47 mysqld_safe mysqld restarted
130407 23:33:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130407 23:33:44 [Note] Plugin 'FEDERATED' is disabled.
130407 23:33:53 InnoDB: The InnoDB memory heap is disabled
130407 23:33:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130407 23:33:57 InnoDB: Compressed tables use zlib 1.2.3
130407 23:33:57 InnoDB: Using Linux native AIO
130407 23:34:20 InnoDB: Initializing buffer pool, size = 128.0M
130407 23:34:30 [Note] Plugin 'FEDERATED' is disabled.
130407 23:34:32 InnoDB: The InnoDB memory heap is disabled
130407 23:34:32 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130407 23:34:32 InnoDB: Compressed tables use zlib 1.2.3
130407 23:34:32 InnoDB: Using Linux native AIO
130407 23:34:55 InnoDB: Initializing buffer pool, size = 128.0M
130407 23:35:02 InnoDB: Completed initialization of buffer pool
130407 23:35:02 InnoDB: Completed initialization of buffer pool
130407 23:35:43 InnoDB: highest supported file format is Barracuda.
InnoDB: Unable to lock ./ib_logfile0, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Error in opening ./ib_logfile0
130407 23:35:45 [ERROR] Plugin 'InnoDB' init function returned error.
130407 23:35:45 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130407 23:35:45 [ERROR] Unknown/unsupported storage engine: InnoDB
130407 23:35:46 [ERROR] Aborting

130407 23:35:46 [Note] /usr/sbin/mysqld: Shutdown complete

And sometime, i received message. It informs overload of VPS, but i run some websites, and the largest website traffic is http://chopho.vn
Code:
This is an automated message notifying you that the 5 minute load average on your system is 12.24.
This has exceeded the 10 threshold.

One Minute      - 26.1
Five Minutes    - 12.24
Fifteen Minutes - 6.99

top - 17:21:06 up 41 min,  0 users,  load average: 26.10, 12.24, 6.99
Tasks: 236 total,   1 running, 235 sleeping,   0 stopped,   0 zombie
Cpu(s): 10.6%us,  2.8%sy,  0.0%ni, 61.9%id, 24.3%wa,  0.0%hi,  0.0%si,  0.2%st
Mem:   1922432k total,  1680392k used,   242040k free,    41040k buffers
Swap:  2064376k total,   642144k used,  1422232k free,    52324k cached

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
4967 apache    20   0  318m  19m 3340 D  5.9  1.0   0:01.24 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
4964 apache    20   0  322m  24m 3712 S  3.9  1.3   0:00.60 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
5000 apache    20   0  344m  13m 2308 D  3.9  0.7   0:00.86 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
5090 apache    20   0  345m  17m 2288 D  3.9  0.9   0:00.93 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
4488 apache    20   0  345m  13m 2252 D  2.0  0.7   0:03.14 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
4859 apache    20   0  345m  13m 2308 D  2.0  0.7   0:01.48 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
5328 chopho    20   0  188m 7820 4824 D  2.0  0.4   0:00.03 php /home/chopho/domains/seo.chopho.vn/public_html/cron.php                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
   1 root      20   0 19228  296  132 S  0.0  0.0   0:00.47 /sbin/init                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
   2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [kthreadd]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
   3 root      RT   0     0    0    0 S  0.0  0.0   0:00.08 [migration/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   4 root      20   0     0    0    0 S  0.0  0.0   0:00.06 [ksoftirqd/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [migration/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   6 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [watchdog/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
   7 root      RT   0     0    0    0 S  0.0  0.0   0:00.01 [migration/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   8 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [migration/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   9 root      20   0     0    0    0 S  0.0  0.0   0:00.05 [ksoftirqd/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  10 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [watchdog/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  11 root      RT   0     0    0    0 S  0.0  0.0   0:00.01 [migration/2]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  12 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [migration/2]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  13 root      20   0     0    0    0 S  0.0  0.0   0:00.06 [ksoftirqd/2]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  14 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [watchdog/2]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  15 root      20   0     0    0    0 S  0.0  0.0   0:00.11 [events/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
  16 root      20   0     0    0    0 S  0.0  0.0   0:00.13 [events/1]
And this message:
Code:
This is an automated message notifying you that the following partition(s) have exceeded the 95% threshold:
97% - /

Please tell me how to fix?

Thanks & Best regards,

Hoang Nguyen
 
The logs is here

Yes, i restart Mysql service. But it's not good solution.

This is the message in logs:
Code:
130315 08:28:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130315  8:28:35 [Note] Plugin 'FEDERATED' is disabled.
130315  8:28:35 InnoDB: The InnoDB memory heap is disabled
130315  8:28:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130315  8:28:35 InnoDB: Compressed tables use zlib 1.2.3
130315  8:28:35 InnoDB: Using Linux native AIO
130315  8:28:35 InnoDB: Initializing buffer pool, size = 128.0M
130315  8:28:35 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
130315  8:28:35  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
130315  8:28:35  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
130315  8:28:36  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
130315  8:28:36  InnoDB: Waiting for the background threads to start
130315  8:28:37 InnoDB: 1.1.8 started; log sequence number 0
130315  8:28:37 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130315  8:28:37 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130315  8:28:37 [Note] Server socket created on IP: '0.0.0.0'.
130315  8:28:37 [Note] Event Scheduler: Loaded 0 events
130315  8:28:37 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.27'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
130407 23:20:41 mysqld_safe Number of processes running now: 0
130407 23:20:41 mysqld_safe mysqld restarted
130407 23:21:05 [Note] Plugin 'FEDERATED' is disabled.
130407 23:21:06 InnoDB: The InnoDB memory heap is disabled
130407 23:21:06 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130407 23:21:06 InnoDB: Compressed tables use zlib 1.2.3
130407 23:21:06 InnoDB: Using Linux native AIO
130407 23:21:06 InnoDB: Initializing buffer pool, size = 128.0M
130407 23:21:10 InnoDB: Completed initialization of buffer pool
130407 23:21:39 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130407 23:21:56  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130407 23:24:04  InnoDB: Waiting for the background threads to start
130407 23:24:06 InnoDB: 1.1.8 started; log sequence number 366492315
130407 23:24:22 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130407 23:24:22 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130407 23:24:23 [Note] Server socket created on IP: '0.0.0.0'.
130407 23:24:31 [Note] Event Scheduler: Loaded 0 events
130407 23:24:31 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.27'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
130407 23:31:41 mysqld_safe Number of processes running now: 0
130407 23:31:47 mysqld_safe mysqld restarted
130407 23:33:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130407 23:33:44 [Note] Plugin 'FEDERATED' is disabled.
130407 23:33:53 InnoDB: The InnoDB memory heap is disabled
130407 23:33:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130407 23:33:57 InnoDB: Compressed tables use zlib 1.2.3
130407 23:33:57 InnoDB: Using Linux native AIO
130407 23:34:20 InnoDB: Initializing buffer pool, size = 128.0M
130407 23:34:30 [Note] Plugin 'FEDERATED' is disabled.
130407 23:34:32 InnoDB: The InnoDB memory heap is disabled
130407 23:34:32 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130407 23:34:32 InnoDB: Compressed tables use zlib 1.2.3
130407 23:34:32 InnoDB: Using Linux native AIO
130407 23:34:55 InnoDB: Initializing buffer pool, size = 128.0M
130407 23:35:02 InnoDB: Completed initialization of buffer pool
130407 23:35:02 InnoDB: Completed initialization of buffer pool
130407 23:35:43 InnoDB: highest supported file format is Barracuda.
InnoDB: Unable to lock ./ib_logfile0, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Error in opening ./ib_logfile0
130407 23:35:45 [ERROR] Plugin 'InnoDB' init function returned error.
130407 23:35:45 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130407 23:35:45 [ERROR] Unknown/unsupported storage engine: InnoDB
130407 23:35:46 [ERROR] Aborting

130407 23:35:46 [Note] /usr/sbin/mysqld: Shutdown complete

Please tell me how to fix?

Thanks & Best regards,

Hoang Nguyen
 
And overload VPS

And sometime, i received message. It informs overload of VPS, but i run some websites, and the largest website traffic is http://chopho.vn
Code:
This is an automated message notifying you that the 5 minute load average on your system is 12.24.
This has exceeded the 10 threshold.

One Minute      - 26.1
Five Minutes    - 12.24
Fifteen Minutes - 6.99

top - 17:21:06 up 41 min,  0 users,  load average: 26.10, 12.24, 6.99
Tasks: 236 total,   1 running, 235 sleeping,   0 stopped,   0 zombie
Cpu(s): 10.6%us,  2.8%sy,  0.0%ni, 61.9%id, 24.3%wa,  0.0%hi,  0.0%si,  0.2%st
Mem:   1922432k total,  1680392k used,   242040k free,    41040k buffers
Swap:  2064376k total,   642144k used,  1422232k free,    52324k cached

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
4967 apache    20   0  318m  19m 3340 D  5.9  1.0   0:01.24 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
4964 apache    20   0  322m  24m 3712 S  3.9  1.3   0:00.60 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
5000 apache    20   0  344m  13m 2308 D  3.9  0.7   0:00.86 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
5090 apache    20   0  345m  17m 2288 D  3.9  0.9   0:00.93 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
4488 apache    20   0  345m  13m 2252 D  2.0  0.7   0:03.14 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
4859 apache    20   0  345m  13m 2308 D  2.0  0.7   0:01.48 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
5328 chopho    20   0  188m 7820 4824 D  2.0  0.4   0:00.03 php /home/chopho/domains/seo.chopho.vn/public_html/cron.php                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
   1 root      20   0 19228  296  132 S  0.0  0.0   0:00.47 /sbin/init                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
   2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 [kthreadd]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
   3 root      RT   0     0    0    0 S  0.0  0.0   0:00.08 [migration/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   4 root      20   0     0    0    0 S  0.0  0.0   0:00.06 [ksoftirqd/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [migration/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   6 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [watchdog/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
   7 root      RT   0     0    0    0 S  0.0  0.0   0:00.01 [migration/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   8 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [migration/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
   9 root      20   0     0    0    0 S  0.0  0.0   0:00.05 [ksoftirqd/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  10 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [watchdog/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  11 root      RT   0     0    0    0 S  0.0  0.0   0:00.01 [migration/2]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  12 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [migration/2]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  13 root      20   0     0    0    0 S  0.0  0.0   0:00.06 [ksoftirqd/2]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  14 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 [watchdog/2]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  15 root      20   0     0    0    0 S  0.0  0.0   0:00.11 [events/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
  16 root      20   0     0    0    0 S  0.0  0.0   0:00.13 [events/1]
And this message:
Code:
This is an automated message notifying you that the following partition(s) have exceeded the 95% threshold:
97% - /

Please tell me how to fix?

Thanks & Best regards,

Hoang Nguyen
 
Please tell me how to fix?

You should add some free space either by deleting some unnecessary files, or ordering more disc space.

Your Apache processes are in status D, i.e. operating with Disk. You should check server-status.

SWAP 642144k is used, that slows the things much, you should consider ordering more RAM, or limit the current usage by optimizing the things.
 
Back
Top