Sur une toute nouvelle installation de Kubuntu 14.04, j'ai couru sudo aptitude install mysql-server-core-5.6
. L'installation n'a pas pu se terminer en raison des dépendances de certains packages KDE mysql-server-core-5.5
, qui auraient été remplacés. Maintenant, lorsque je cours, sudo aptitude install mysql-server-5.5
j'obtiens cette erreur après avoir spécifié un mot de passe:
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.
J'ai en fait lu /usr/share/doc/mysql-server-5.5/README.Debian
mais il n'y avait rien de pertinent pour ma situation. Le journal MySQL aide:
$ 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]
Cependant, je ne trouve pas dans quel script l' --explicit_defaults_for_timestamp
option est définie. J'ai essayé de démarrer mysql
sans service
pour éviter l' --explicit_defaults_for_timestamp
option mais elle ne démarre toujours pas:
$ 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
L'erreur me le dit Remove all --log-error configuration options
. J'ai donc édité /etc/mysql/my.cnf
et commenté la ligne suivante:
log-error = /var/log/mysql/error.log
Maintenant je ne reçois aucune erreur mais je ne peux toujours pas me connecter:
$ 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)
Quel pourrait être le problème? Comment dois-je procéder?
ÉDITER
J'ai maintenant commenté la explicit-defaults-for-timestamp
ligne my.cnf
. Voici l'intégralité du fichier, moins les commentaires d'en-tête:
$ 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/
Voici ce qui se passe lorsque j'essaie d'exécuter 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
Comme on peut le voir, rien de nouveau n'est écrit dans les journaux et l' explicit_defaults_for_timestamp
option n'est définie nulle part.
J'ai pu réinstaller mysql-server-core-5.5
mais cela n'a pas résolu le problème:
$ 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
Celui 1
de la dernière ligne du journal a été ajouté précédemment avec echo
et indique que rien de nouveau n'a été ajouté au journal.
timestamp
n'a été trouvée que dans etc/mysql/my.cnf
et je l'ai supprimée. Pourtant, je reçois toujours la même mention dans le journal.