Форум русскоязычного сообщества Ubuntu


Хотите сделать посильный вклад в развитие Ubuntu и русскоязычного сообщества?
Помогите нам с документацией!

Автор Тема: Не могу запустить MySQL — нет соединения через сокет /var/run/mysqld/mysqld.sock  (Прочитано 9621 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн Katjusha

  • Автор темы
  • Новичок
  • *
  • Сообщений: 6
    • Просмотр профиля
Всем доброго времени суток! Проблема в следующем, я обновилась с помощью apt-get dist-upgrade на удаленном сервере (на нем находятся сайты) и после ребута подключилась по фтп (фтп слава Богу работает), пробую зайти на сайт, а там... нет соединения с MySQL. При попытке запустить service mysql start выдал 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'. Пройдя по указанному пути файл mysqld.sock, как и сказал капитан очевидец, найден не был   :-\

Версия ubuntu:
Ubuntu 14.04.4 LTS

Версия ядра:
Linux server 3.13.0-85-generic #129-Ubuntu SMP Thu Mar 17 20:50:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Лог мускула. Начал плодиться с неимоверной скоростью, сразу после перезагрузки стали заметны тормоза на FTP и в консоли(Putty).  :o  :idiot2: мускул начал рекурсивно сходить с ума.  :'(
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 346701 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x20)[0x7f6b4255e6b0]
/usr/sbin/mysqld(handle_fatal_signal+0x3d5)[0x7f6b424481c5]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340)[0x7f6b411d7340]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39)[0x7f6b4082ecc9]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f6b408320d8]
/usr/sbin/mysqld(+0x5d89a0)[0x7f6b426449a0]
/usr/sbin/mysqld(+0x59fe88)[0x7f6b4260be88]
/usr/sbin/mysqld(+0x57b269)[0x7f6b425e7269]
/usr/sbin/mysqld(+0x57bbcb)[0x7f6b425e7bcb]
/usr/sbin/mysqld(+0x56caa6)[0x7f6b425d8aa6]
/usr/sbin/mysqld(+0x549e70)[0x7f6b425b5e70]
/usr/sbin/mysqld(+0x53ffa6)[0x7f6b425abfa6]
/usr/sbin/mysqld(+0x540cf3)[0x7f6b425accf3]
/usr/sbin/mysqld(+0x542747)[0x7f6b425ae747]
/usr/sbin/mysqld(+0x52fc3e)[0x7f6b4259bc3e]
/usr/sbin/mysqld(+0x4fef98)[0x7f6b4256af98]
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x41)[0x7f6b4244a1f1]
/usr/sbin/mysqld(+0x302d11)[0x7f6b4236ed11]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0x92a)[0x7f6b42372d0a]
/usr/sbin/mysqld(+0x28b2ab)[0x7f6b422f72ab]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x45b)[0x7f6b422fbc0b]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f6b40819ec5]
/usr/sbin/mysqld(+0x287168)[0x7f6b422f3168]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
160407  9:55:45 [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.
160407  9:55:45 [Note] Plugin 'FEDERATED' is disabled.
160407  9:55:45 InnoDB: The InnoDB memory heap is disabled
160407  9:55:45 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160407  9:55:45 InnoDB: Compressed tables use zlib 1.2.8
160407  9:55:45 InnoDB: Using Linux native AIO
160407  9:55:45 InnoDB: Initializing buffer pool, size = 128.0M
160407  9:55:45 InnoDB: Completed initialization of buffer pool
160407  9:55:45 InnoDB: highest supported file format is Barracuda.
InnoDB: Error: tried to read 16384 bytes at offset 0 47742976.
InnoDB: Was only able to read 8192.
InnoDB: Fatal error: cannot read from file. OS error number 17.

// неужели повредились InnoDB файлы ???  :'(

160407  9:55:47  InnoDB: Assertion failure in thread 140597047510912 in file os0file.c line 2549
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://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: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
06:55:47 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 346701 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Конфиг мускла
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size         = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/


Что было мной предпринято (сразу поняла что дело пахнет керосином)  >:( Все ниже описанные действия естественно под рутом  ;)
Цитировать
cp /var/lib/mysql /var/lib/mysql.backup

Не помогло:
mkfifo /var/run/mysqld/mysqld.sock
// смутило название созданного файла с палкой |mysqld.sock, может я чего то не знаю...
chown -R mysql /var/run/mysqld
chmod 777 /var/run/mysqld/mysqld.sock

Не помогло:
Цитировать
apt-get inslall --reinstall mysql-server


Я так полагаю что, повредились InnoDB файлы. Как быть ?  :'(
« Последнее редактирование: 18 Апреля 2016, 11:33:56 от Azure »

Оффлайн mihasЬ

  • Забанен
  • Участник
  • *
  • Сообщений: 236
    • Просмотр профиля

Оффлайн Katjusha

  • Автор темы
  • Новичок
  • *
  • Сообщений: 6
    • Просмотр профиля
http://softodom.com/516/mysql-cant-connect-through-socket-reshenie-problemy.html

Все что там написано сделано, проблема не в недостатке памяти.

Оффлайн mihasЬ

  • Забанен
  • Участник
  • *
  • Сообщений: 236
    • Просмотр профиля
Katjusha,
Или я не понял, или вы не объяснили. Заходите на сайт, а ищете на компе?

Оффлайн Katjusha

  • Автор темы
  • Новичок
  • *
  • Сообщений: 6
    • Просмотр профиля
Katjusha,
Или я не понял, или вы не объяснили. Заходите на сайт, а ищете на компе?

Нахожусь я сейчас дома, сервер находиться удаленно, я подключаюсь к нему по SSH и FTP. Получается что проблема на удаленном сервере (c OS Ubuntu) и к моему компьютеру (с OS Windows) ни какого отношения не имеет.
« Последнее редактирование: 07 Апреля 2016, 13:38:09 от Katjusha »

Оффлайн wolf-ser

  • Новичок
  • *
  • Сообщений: 4
    • Просмотр профиля
Цитировать
sudo ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
Помог такой костыль.

Оффлайн Katjusha

  • Автор темы
  • Новичок
  • *
  • Сообщений: 6
    • Просмотр профиля
Цитировать
sudo ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
Помог такой костыль.

Спасибо ОГРОМНОЕ, помогло, но...
(Нажмите, чтобы показать/скрыть)
...костыль, пока и так сойдет :)
Видимо что то с конфигурацией или как я и предполагала полетела база InnoDB.
Если разберусь, то отпишусь.
« Последнее редактирование: 18 Апреля 2016, 11:06:07 от Katjusha »

Оффлайн wolf-ser

  • Новичок
  • *
  • Сообщений: 4
    • Просмотр профиля
Попробуй полностью удалить mysql, apt-get purge mysql-server-5.1 mysql-common (версия может быть другой поменяй на свою), а потом снова установить.
Базы не удалятся. Перед установкой удали базу mysql, самой программы (при установке вызовет ошибку с паролем для бд).

Оффлайн Katjusha

  • Автор темы
  • Новичок
  • *
  • Сообщений: 6
    • Просмотр профиля
Попробуй полностью удалить mysql, apt-get purge mysql-server-5.1 mysql-common (версия может быть другой поменяй на свою), а потом снова установить.
Базы не удалятся. Перед установкой удали базу mysql, самой программы (при установке вызовет ошибку с паролем для бд).

Восстановила InnoDB вот по этой статье https://habrahabr.ru/post/125358/ и все заработало :) Всем спасибо )

 

Страница сгенерирована за 0.034 секунд. Запросов: 25.