E
E
Eugene A2015-06-17 13:01:53
MySQL
Eugene A, 2015-06-17 13:01:53

How to solve error 2002 mysql on ubuntu server?

Hello comrades,
a server on ubuntu 14 with a lamp on board lived quietly for almost a year, on server 2 of the wordpress site. Last night I found that the site could not connect to the database, when I tried to enter mysql through the terminal - it gave an error

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

I rummaged through the forum , read the recommendations - I did it, there is no result. The server is provided by the Digital Ocean company - I rolled up a backup 3 days ago - everything started and after 1 minute the muscle curled up again. With backups, the same story is older.
Mysql-server does not start
Please tell me which way to look, what logs to show you? Thanks
UPD: I saw such a situation when the muscle did not start due to lack of disk space, but in my case - go for a walk.
~$ sudo service mysql restart
[sudo] password for ~: 
stop: Unknown instance: 
start: Job failed to start

logs
150617  8:01:25 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
150617  8:01:25 [Note] Plugin 'FEDERATED' is disabled.
150617  8:01:25 InnoDB: The InnoDB memory heap is disabled
150617  8:01:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150617  8:01:25 InnoDB: Compressed tables use zlib 1.2.8
150617  8:01:25 InnoDB: Using Linux native AIO
150617  8:01:25 InnoDB: Initializing buffer pool, size = 128.0M
150617  8:01:25 InnoDB: Completed initialization of buffer pool
150617  8:01:25 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!
150617  8:01:25  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...
150617  8:01:27  InnoDB: Waiting for the background threads to start
150617  8:01:28 InnoDB: 5.5.43 started; log sequence number 874386956
150617  8:01:28 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
150617  8:01:28 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
150617  8:01:28 [Note] Server socket created on IP: '127.0.0.1'.
150617  8:01:28 [Note] Event Scheduler: Loaded 0 events
150617  8:01:28 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.43-0ubuntu0.14.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
150617  8:01:28  InnoDB: Error: page 3235 log sequence number 874387332
InnoDB: is in the future! Current system log sequence number 874386956.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: for more information.
150617  8:01:28  InnoDB: Error: page 3718 log sequence number 874387295
InnoDB: is in the future! Current system log sequence number 874386956.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: for more information.
150617  8:01:29 [ERROR] /usr/sbin/mysqld: Table './etnicasmain/wp_options' is marked as crashed and should be repaired
150617  8:01:29 [Warning] Checking table:   './etnicasmain/wp_options'
150617  8:01:30 [ERROR] /usr/sbin/mysqld: Table './phpmyadmin/pma_column_info' is marked as crashed and should be repaired
150617  8:01:30 [Warning] Checking table:   './phpmyadmin/pma_column_info'
150617  8:01:30 [ERROR] /usr/sbin/mysqld: Table './phpmyadmin/pma_recent' is marked as crashed and should be repaired
150617  8:01:30 [Warning] Checking table:   './phpmyadmin/pma_recent'
150617  8:01:30 [ERROR] /usr/sbin/mysqld: Table './phpmyadmin/pma_userconfig' is marked as crashed and should be repaired
150617  8:01:30 [Warning] Checking table:   './phpmyadmin/pma_userconfig'
150617  8:01:30 [ERROR] /usr/sbin/mysqld: Table './pulspro/wp_options' is marked as crashed and should be repaired
150617  8:01:30 [Warning] Checking table:   './pulspro/wp_options'

above the backup log that works.
Here is the log from the last backup of the non-working one - the log , alas, but it does not fit here.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-06-17
@AstrallRomance

150617 8:42:00 AM [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.43-0ubuntu0.14.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
150617 8:42:00 AM InnoDB: Assertion failure in thread 139884593407744 in file trx0purge. c line 840
InnoDB: Failing assertion: purge_sys->purge_trx_no <= purge_sys->rseg->last_trx_no
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: dev.mysql.com/doc/refman/5.5/en/forcing-innodb-rec...
InnoDB: about forcing recovery.

Judging by the log, InnoDB has crashed.
When this happened to one of our servers, we turned on innodb_force_recovery (see the link from the log for more information), backed up the database, deleted the entire InnoDB directory, created the databases again and imported data from the backup into them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question