Não é possível iniciar o servidor mysql [fechado]

1

Estou tentando executar um site do meu servidor, então eu instalei o php, o apache e o mysql.

Estou tendo problemas com o mysql. Após a instalação, não foi possível reiniciar.

Esta é a saída:

root@ns213360:/etc/mysql# /etc/init.d/mysql start ; tail -n 50 /var/log/syslog
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
Apr  3 09:27:22 ns213360 mysqld: 140403  9:27:22 InnoDB: Using Linux native AIO
Apr  3 09:27:22 ns213360 mysqld: 140403  9:27:22 InnoDB: Initializing buffer pool, size = 128.0M
Apr  3 09:27:22 ns213360 mysqld: 140403  9:27:22 InnoDB: Completed initialization of buffer pool
Apr  3 09:27:22 ns213360 mysqld: 140403  9:27:22 InnoDB: highest supported file format is Barracuda.
Apr  3 09:27:22 ns213360 mysqld: 140403  9:27:22  InnoDB: Waiting for the background threads to start
Apr  3 09:27:23 ns213360 mysqld: 140403  9:27:23 InnoDB: 5.5.35 started; log sequence number 1595685
Apr  3 09:27:23 ns213360 mysqld: 140403  9:27:23 [ERROR] /usr/sbin/mysqld: unknown variable 'default-character-set=utf8'
Apr  3 09:27:23 ns213360 mysqld: 140403  9:27:23 [ERROR] Aborting
Apr  3 09:27:23 ns213360 mysqld:
Apr  3 09:27:23 ns213360 mysqld: 140403  9:27:23  InnoDB: Starting shutdown...
Apr  3 09:27:24 ns213360 mysqld: 140403  9:27:24  InnoDB: Shutdown completed; log sequence number 1595685
Apr  3 09:27:24 ns213360 mysqld: 140403  9:27:24 [Note] /usr/sbin/mysqld: Arrêt du serveur terminé
Apr  3 09:27:24 ns213360 mysqld:
Apr  3 09:27:24 ns213360 mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
Apr  3 09:27:36 ns213360 /etc/init.d/mysql[24960]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Apr  3 09:27:36 ns213360 /etc/init.d/mysql[24960]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Apr  3 09:27:36 ns213360 /etc/init.d/mysql[24960]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Apr  3 09:27:36 ns213360 /etc/init.d/mysql[24960]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Apr  3 09:27:36 ns213360 /etc/init.d/mysql[24960]:
Apr  3 09:28:01 ns213360 /USR/SBIN/CRON[24980]: (root) CMD (/usr/local/rtm/bin/rtm 40 > /dev/null 2> /dev/null)
Apr  3 09:29:01 ns213360 /USR/SBIN/CRON[25025]: (root) CMD (/usr/local/rtm/bin/rtm 40 > /dev/null 2> /dev/null)
Apr  3 09:29:19 ns213360 mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 [ERROR] An old style --language value with language specific part detected: /usr/share/mysql/french/
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 [ERROR] Use --lc-messages-dir without language specific part instead.
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 [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.
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 [Note] Plugin 'FEDERATED' is disabled.
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 InnoDB: The InnoDB memory heap is disabled
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 InnoDB: Compressed tables use zlib 1.2.7
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 InnoDB: Using Linux native AIO
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 InnoDB: Initializing buffer pool, size = 128.0M
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 InnoDB: Completed initialization of buffer pool
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19 InnoDB: highest supported file format is Barracuda.
Apr  3 09:29:19 ns213360 mysqld: 140403  9:29:19  InnoDB: Waiting for the background threads to start
Apr  3 09:29:20 ns213360 mysqld: 140403  9:29:20 InnoDB: 5.5.35 started; log sequence number 1595685
Apr  3 09:29:20 ns213360 mysqld: 140403  9:29:20 [ERROR] /usr/sbin/mysqld: unknown variable 'default-character-set=utf8'
Apr  3 09:29:20 ns213360 mysqld: 140403  9:29:20 [ERROR] Aborting
Apr  3 09:29:20 ns213360 mysqld:
Apr  3 09:29:20 ns213360 mysqld: 140403  9:29:20  InnoDB: Starting shutdown...
Apr  3 09:29:21 ns213360 mysqld: 140403  9:29:21  InnoDB: Shutdown completed; log sequence number 1595685
Apr  3 09:29:21 ns213360 mysqld: 140403  9:29:21 [Note] /usr/sbin/mysqld: Arrêt du serveur terminé
Apr  3 09:29:21 ns213360 mysqld:
Apr  3 09:29:21 ns213360 mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
Apr  3 09:29:33 ns213360 /etc/init.d/mysql[25685]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Apr  3 09:29:33 ns213360 /etc/init.d/mysql[25685]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Apr  3 09:29:33 ns213360 /etc/init.d/mysql[25685]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Apr  3 09:29:33 ns213360 /etc/init.d/mysql[25685]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Apr  3 09:29:33 ns213360 /etc/init.d/mysql[25685]:
    
por user1708580 03.04.2014 / 09:34

2 respostas

2

De acordo com o log, há um erro com uma variável: unknown variable 'default-character-set=utf8'

default-character-set é uma variável usada para o cliente e não para o servidor.

Eu suspeito que no seu arquivo /etc/mysql/my.cnf , há uma linha

  

default-character-set = utf8

na seção [mysqld] em vez da seção [mysql] ou [client] .

Se você quiser forçar seu servidor a executar o conjunto de caracteres UTF8 por padrão, no arquivo my.cnf , você precisa colocar

  

character-set-server = utf8

na seção [mysqld] .

Portanto, o seu arquivo my.cnf deve ser assim:

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
character-set-server = utf8
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'

as duas últimas linhas estão lá para reforçar o uso do agrupamento UTF8 'case insensitive' junto com o conjunto de caracteres UTF8.

Uma vez que seu MySQL será iniciado, você pode verificar se o UTF8 é usado emitindo o seguinte comando no prompt do Mysql:

mysql> show variables like 'char%';

dando um resultado como este (para meu próprio servidor - o seu pode ser diferente):

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
    
por Benoit 03.04.2014 / 11:46
-1

De acordo com este , você precisa mudar a linha

default-character-set=uf8

no arquivo /etc/my.cnf para:

character-set-system=utf8

e tente novamente iniciar o servidor.

    
por Jos 03.04.2014 / 10:44