[MySQL 5.7.17] mysqld --initialize failed
J'ai fait une fresh install de MySQL 5.7 sur RedHat 8
Code:
1 2 3
| wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum localinstall mysql57-community-release-el7-7.noarch.rpm
yum-config-manager --enable mysql57-community |
J'ai créé mon /etc/mysql/my.cnt mimimal
Code:
1 2 3 4 5 6 7 8 9
| [mysqld]
join_buffer_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M
datadir=/mysql/data/01
socket=/mysql/admin/01.sock
log-error=/mysql/log/errorlog01.log
pid-file=/mysql/admin/01.pid |
Initialement, mon répertoire /mysql/data/01 est vide
J'exécute, en tant que mysql, un
Code:
1 2 3 4 5 6
| -bash-4.2$ mysqld --initialize
2017-01-05T15:36:44.058893Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-01-05T15:36:44.058983Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-01-05T15:36:44.059154Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-05T15:36:44.061281Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2017-01-05T15:36:44.061307Z 0 [ERROR] Aborting |
... et effectivement, the data directory has (maintenant) files in it... puisque je lui demande justement de les créer !
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| -bash-4.2$ ls -l /mysql/data/01/
total 110660
-rw-r-----. 1 mysql mysql 56 Jan 5 16:36 auto.cnf
-rw-------. 1 mysql mysql 1675 Jan 5 16:36 ca-key.pem
-rw-r--r--. 1 mysql mysql 1074 Jan 5 16:36 ca.pem
-rw-r--r--. 1 mysql mysql 1078 Jan 5 16:36 client-cert.pem
-rw-------. 1 mysql mysql 1679 Jan 5 16:36 client-key.pem
-rw-r-----. 1 mysql mysql 413 Jan 5 16:36 ib_buffer_pool
-rw-r-----. 1 mysql mysql 12582912 Jan 5 16:36 ibdata1
-rw-r-----. 1 mysql mysql 50331648 Jan 5 16:36 ib_logfile0
-rw-r-----. 1 mysql mysql 50331648 Jan 5 16:36 ib_logfile1
drwxr-x---. 2 mysql mysql 4096 Jan 5 16:36 mysql
drwxr-x---. 2 mysql mysql 8192 Jan 5 16:36 performance_schema
-rw-------. 1 mysql mysql 1675 Jan 5 16:36 private_key.pem
-rw-r--r--. 1 mysql mysql 451 Jan 5 16:36 public_key.pem
-rw-r--r--. 1 mysql mysql 1078 Jan 5 16:36 server-cert.pem
-rw-------. 1 mysql mysql 1675 Jan 5 16:36 server-key.pem
drwxr-x---. 2 mysql mysql 8192 Jan 5 16:36 sys |
Le service ne va pas mieux.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| -bash-4.2$ service mysqld status
Redirecting to /bin/systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: activating (start-pre) since Thu 2017-01-05 16:44:09 CET; 2s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 31982 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Control: 31999 (mysqld_pre_syst)
CGroup: /system.slice/mysqld.service
└─control
├─31999 /bin/bash /usr/bin/mysqld_pre_systemd
└─32056 /usr/bin/python -Es /usr/sbin/semanage fcontext -a -e /var/lib/mysql /var/lib/mysql-keyring |
Je reboote donc le serveur et essaie de démarrer le service
Code:
1 2
| -bash-4.2# systemctl start mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| -bash-4.2# systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: activating (start-pre) since Thu 2017-01-05 16:52:13 CET; 2s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 6567 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Control: 6584 (mysqld_pre_syst)
CGroup: /system.slice/mysqld.service
└─control
├─6584 /bin/bash /usr/bin/mysqld_pre_systemd
└─6603 /usr/bin/python -Es /usr/sbin/semanage fcontext -a -e /var/lib/mysql /var/lib/mysql-keyring
Jan 05 16:52:13 mysql-p01.infra.vs.ch systemd[1]: Starting MySQL Server... |
Comment passer ces écueil ?