Проблемы Ubuntu 12.04 с mysql

Я использую Сервер Ubuntu 12.04 для моего проекта Django. На моем локальном ПК нет никаких ошибок и и т.д. Иногда на сервере у меня есть ошибка:

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

Журналы:

cat /var/log/mysql/error.log
140415 23:05:34 [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.
140415 23:05:34 [Note] Plugin 'FEDERATED' is disabled.
140415 23:05:34 InnoDB: The InnoDB memory heap is disabled
140415 23:05:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140415 23:05:34 InnoDB: Compressed tables use zlib 1.2.3.4
140415 23:05:34 InnoDB: Initializing buffer pool, size = 128.0M
140415 23:05:34 InnoDB: Completed initialization of buffer pool
140415 23:05:34 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!
140415 23:05:34  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...
140415 23:05:35 [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.
140415 23:05:35 [Note] Plugin 'FEDERATED' is disabled.
140415 23:05:35 InnoDB: The InnoDB memory heap is disabled
140415 23:05:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140415 23:05:35 InnoDB: Compressed tables use zlib 1.2.3.4
140415 23:05:35 InnoDB: Initializing buffer pool, size = 128.0M
140415 23:05:35 InnoDB: Completed initialization of buffer pool
140415 23:05:35 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!
140415 23:05:35  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...

Я вижу, что ошибка (2002) очень часто, не могу понять - почему это появляется.

Я пробую /etc/init.d/mysql restart или service mysql restart, но это не помогает. У меня есть mysql-сервер, не клиент. Таким образом, это работает, работает, работы, и за один прекрасный момент я вижу ту ошибку.

ps ax | grep mysql
15654 pts/0    S+     0:00 grep --color=auto mysql

Так, я пробую

sudo service mysql start
start: Job failed to start

Журналы:

140416  1:11:17 [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.
140416  1:11:17 [Note] Plugin 'FEDERATED' is disabled.
140416  1:11:17 InnoDB: The InnoDB memory heap is disabled
140416  1:11:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140416  1:11:17 InnoDB: Compressed tables use zlib 1.2.3.4
140416  1:11:17 InnoDB: Initializing buffer pool, size = 128.0M

dpkg -l | grep mysql
ii  libdbd-mysql-perl                    4.020-1build2                     Perl5 database interface to the MySQL database
ii  libmysqlclient18                     5.5.35-0ubuntu0.12.04.2           MySQL database client library
ii  mysql-client-5.5                     5.5.35-0ubuntu0.12.04.2           MySQL database client binaries
ii  mysql-client-core-5.5                5.5.35-0ubuntu0.12.04.2           MySQL database core client binaries
ii  mysql-common                         5.5.35-0ubuntu0.12.04.2           MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                         5.5.35-0ubuntu0.12.04.2           MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.5                     5.5.35-0ubuntu0.12.04.2           MySQL database server binaries and system database setup
ii  mysql-server-core-5.5                5.5.35-0ubuntu0.12.04.2           MySQL database server binaries
ii  python-mysqldb                       1.2.3-1ubuntu0.1                  Python interface to MySQL

Как зафиксировать это? Как перезапустить? Почему я вижу ту ошибку? Что случилось?

Thaks.

ОБНОВЛЕНИЕ

grep socket /etc/mysql/my.cnf                       
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
socket      = /var/run/mysqld/mysqld.sock
#socket=/var/lib/mysql/mysql.sock
socket      = /var/run/mysqld/mysqld.sock
socket      = /var/run/mysqld/mysqld.sock

И

/var/run/mysqld$ ls -la
total 4
drwxr-xr-x  2 mysql root   80 Apr 13 12:06 .
drwxr-xr-x 16 root  root  520 Apr 16 01:33 ..
-rw-rw----  1 mysql mysql   4 Apr 13 12:06 mysqld.pid
srwxrwxrwx  1 mysql mysql   0 Apr 13 12:06 mysqld.sock
1
задан 16 April 2014 в 01:35

0 ответов

Другие вопросы по тегам:

Похожие вопросы: