Ho eseguito una nuova installazione di Kubuntu 14.04 sudo aptitude install mysql-server-core-5.6
. Impossibile completare l'installazione a causa delle dipendenze di alcuni pacchetti di KDE mysql-server-core-5.5
, che sarebbero stati sostituiti. Ora quando corro sudo aptitude install mysql-server-5.5
ottengo questo errore dopo aver specificato una password:
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.
In effetti ho letto /usr/share/doc/mysql-server-5.5/README.Debian
ma non c'era nulla di rilevante per la mia situazione. Il registro MySQL aiuta:
$ 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]
Tuttavia, non riesco a trovare in quale script --explicit_defaults_for_timestamp
è impostata l' opzione. Ho provato a iniziare mysql
senza service
per evitare l' --explicit_defaults_for_timestamp
opzione ma ancora non si avvia:
$ 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'errore mi dice di Remove all --log-error configuration options
. Ho quindi modificato /etc/mysql/my.cnf
e commentato la seguente riga:
log-error = /var/log/mysql/error.log
Ora non ricevo errori ma non riesco ancora ad accedere:
$ 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)
Quale potrebbe essere il problema? Come devo procedere?
MODIFICARE
Ora ho commentato la explicit-defaults-for-timestamp
riga in my.cnf
. Ecco l'intero file, meno i commenti dell'intestazione:
$ 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/
Questo è ciò che accade quando provo a eseguire 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
Come si può vedere, nei log non viene scritto nulla di nuovo e l' explicit_defaults_for_timestamp
opzione non è impostata da nessuna parte.
Sono stato in grado di reinstallare mysql-server-core-5.5
ma questo non ha risolto il 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
Quello 1
sull'ultima riga del registro è stato aggiunto in precedenza con echo
e indica che non è stato aggiunto nulla di nuovo al registro.
timestamp
stata trovata solo in etc/mysql/my.cnf
e l'ho commentata. Tuttavia, ho ancora la stessa menzione nel registro.