En una nueva instalación de Kubuntu 14.04, corrí sudo aptitude install mysql-server-core-5.6
. La instalación no pudo completarse debido a las dependencias de algunos paquetes de KDE mysql-server-core-5.5
, que habrían sido reemplazados. Ahora, cuando ejecuto sudo aptitude install mysql-server-5.5
, aparece este error después de especificar una contraseña:
Configuring mysql-server-5.5
Unable to set password for the MySQL "root" user
An error occurred while setting the password for the MySQL administrative user. This may have happened
because the account already has a password, or because of a communication problem with the MySQL server.
You should check the account's password after the package installation.
Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more information.
De hecho, he leído /usr/share/doc/mysql-server-5.5/README.Debian
pero no había nada relevante para mi situación. El registro de MySQL ayuda a:
$ tail /var/log/mysql/error.log
140818 10:17:16 InnoDB: Completed initialization of buffer pool
140818 10:17:16 InnoDB: highest supported file format is Barracuda.
140818 10:17:16 InnoDB: Waiting for the background threads to start
140818 10:17:17 InnoDB: 5.5.38 started; log sequence number 1595675
140818 10:17:17 [ERROR] /usr/sbin/mysqld: unknown option '--explicit_defaults_for_timestamp'
140818 10:17:17 [ERROR] Aborting
140818 10:17:17 InnoDB: Starting shutdown...
140818 10:17:18 InnoDB: Shutdown completed; log sequence number 1595675
140818 10:17:18 [Note]
Sin embargo, no puedo encontrar en qué script --explicit_defaults_for_timestamp
está configurada la opción. Traté de comenzar mysql
sin service
evitar la --explicit_defaults_for_timestamp
opción, pero todavía no se inicia:
$ ps aux | grep mysql
dotanco+ 25458 0.0 0.0 11748 928 pts/4 S+ 10:30 0:00 grep --color=auto mysql
$ sudo mysqld_safe --skip-grant-tables &
[1] 25470
140818 10:30:54 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
140818 10:30:54 mysqld_safe Logging to '/var/log/mysql/error.log'.
140818 10:30:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140818 10:30:57 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
[1]+ Done sudo mysqld_safe --skip-grant-tables
$ ps aux | grep mysql
dotanco+ 25810 0.0 0.0 11748 932 pts/4 S+ 10:31 0:00 grep --color=auto mysql
El error me dice que lo haga Remove all --log-error configuration options
. Por lo tanto, edité /etc/mysql/my.cnf
y comenté la siguiente línea:
log-error = /var/log/mysql/error.log
Ahora no recibo ningún error pero aún no puedo iniciar sesión:
$ sudo mysqld_safe --skip-grant-tables &
[1] 26558
140818 10:34:37 mysqld_safe Logging to syslog.
140818 10:34:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140818 10:34:40 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
[1]+ Done sudo mysqld_safe --skip-grant-tables
$ mysql -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
¿Cuál podría ser el problema? ¿Cómo debo proceder?
EDITAR
Ahora he comentado la explicit-defaults-for-timestamp
línea my.cnf
. Aquí está el archivo completo, menos los comentarios del encabezado:
$ cat /etc/mysql/my.cnf
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
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
#explicit_defaults_for_timestamp
bind-address = 127.0.0.1
#log-error = /var/log/mysql/error.log
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
symbolic-links=0
!includedir /etc/mysql/conf.d/
Esto es lo que sucede cuando intento ejecutar MySQL:
$ sudo echo 1 >> /var/log/mysql/error.log
$ tail /var/log/mysql/error.log
140818 10:31:49 InnoDB: Waiting for the background threads to start
140818 10:31:50 InnoDB: 5.5.38 started; log sequence number 1595675
140818 10:31:50 [ERROR] /usr/sbin/mysqld: unknown option '--explicit_defaults_for_timestamp'
140818 10:31:50 [ERROR] Aborting
140818 10:31:50 InnoDB: Starting shutdown...
140818 10:31:51 InnoDB: Shutdown completed; log sequence number 1595675
140818 10:31:51 [Note]
140818 10:31:51 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
1
$ sudo service mysql start
start: Job failed to start
$ tail /var/log/mysql/error.log
140818 10:31:49 InnoDB: Waiting for the background threads to start
140818 10:31:50 InnoDB: 5.5.38 started; log sequence number 1595675
140818 10:31:50 [ERROR] /usr/sbin/mysqld: unknown option '--explicit_defaults_for_timestamp'
140818 10:31:50 [ERROR] Aborting
140818 10:31:50 InnoDB: Starting shutdown...
140818 10:31:51 InnoDB: Shutdown completed; log sequence number 1595675
140818 10:31:51 [Note]
140818 10:31:51 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
1
$ grep explicit_defaults_for_timestamp /etc/mysql/my.cnf /etc/init.d/mysql /etc/default/mysql
/etc/mysql/my.cnf:#explicit_defaults_for_timestamp
grep: /etc/default/mysql: No such file or directory
Como se puede ver, no se escribe nada nuevo en los registros, y la explicit_defaults_for_timestamp
opción no está establecida en ningún lado.
Pude reinstalar mysql-server-core-5.5
pero eso no resolvió el problema:
$ sudo aptitude reinstall mysql-server-core-5.5
The following packages will be REINSTALLED:
mysql-server-core-5.5
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 3,213 kB of archives. After unpacking 0 B will be used.
Get: 1 http://il.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server-core-5.5 amd64 5.5.38-0ubuntu0.14.04.1 [3,213 kB]
Fetched 3,213 kB in 1s (3,163 kB/s)
(Reading database ... 217167 files and directories currently installed.)
Preparing to unpack .../mysql-server-core-5.5_5.5.38-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-server-core-5.5 (5.5.38-0ubuntu0.14.04.1) over (5.5.38-0ubuntu0.14.04.1) ...
Replaced by files in installed package mysql-common (5.6.20-1ubuntu14.04) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up mysql-server-core-5.5 (5.5.38-0ubuntu0.14.04.1) ...
$ sudo service mysql status
mysql stop/waiting
$ sudo service mysql start
start: Job failed to start
$ tail /var/log/mysql/error.log
140818 10:31:49 InnoDB: Waiting for the background threads to start
140818 10:31:50 InnoDB: 5.5.38 started; log sequence number 1595675
140818 10:31:50 [ERROR] /usr/sbin/mysqld: unknown option '--explicit_defaults_for_timestamp'
140818 10:31:50 [ERROR] Aborting
140818 10:31:50 InnoDB: Starting shutdown...
140818 10:31:51 InnoDB: Shutdown completed; log sequence number 1595675
140818 10:31:51 [Note]
140818 10:31:51 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
1
Eso 1
en la última línea del registro se agregó anteriormente con echo
, e indica que no se agregó nada nuevo al registro.
timestamp
se encontró solo dentro etc/mysql/my.cnf
y la he comentado. Sin embargo, todavía recibo la misma mención en el registro.