Instalei o mysql-community-server 8.0 no Oracle Linux 7 usando a documentação oficial
Foi instalado com sucesso, mas:
# service mysqld start
resultou em:
Redirecting to /bin/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.
[root@myhost tmp]# journalctl -xe
Oct 02 16:19:29 myhost systemd[1]: Starting MySQL Server...
-- Subject: Unit mysqld.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has begun starting up.
Oct 02 16:19:39 myhost systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Oct 02 16:19:39 myhost systemd[1]: Failed to start MySQL Server.
-- Subject: Unit mysqld.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has failed.
--
-- The result is failed.
Oct 02 16:19:39 myhost systemd[1]: Unit mysqld.service entered failed state.
Oct 02 16:19:39 myhost systemd[1]: mysqld.service failed.
[root@myhost tmp]# vi /var/log/mysqld.log
2019-10-02T13:19:36.151426Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17) starting as process 21346
2019-10-02T13:19:38.162471Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-10-02T13:19:38.165671Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2019-10-02T13:19:38.165697Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2019-10-02T13:19:38.166475Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-10-02T13:19:38.958654Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
[root@myhost tmp]# ps aux | grep mysql
root 2031 0.0 0.0 115388 3108 ? S 11:59 0:00 /bin/sh /opt/zbox/run/mysql/mysqld_safe --defaults-file=/opt/zbox/etc/mysql/my.cnf
nobody 2487 0.0 0.4 525380 36448 ? Sl 11:59 0:00 /opt/zbox/run/mysql/mysqld --defaults-file=/opt/zbox/etc/mysql/my.cnf --basedir=/opt/zbox/run/mysql --datadir=/opt/zbox/data/mysql --plugin-dir=/opt/zbox/run/lib/mysql/plugin --user=nobody --log-error=/opt/zbox/logs/mysql_error.log --pid-file=/opt/zbox/tmp/mysql/mysqld.pid --socket=/opt/zbox/tmp/mysql/mysql.sock --port=3306
Eu encontrei o arquivo de configuração do mysql-community-server localizado pelo caminho: /etc/my.cnf
. Mas não contém informações sobre a configuração da porta. /etc/my.cnf.d/
pasta está vazia.
Como eu poderia mudar sua porta?
https://dev.mysql.com/doc/refman/8.0/en/using-systemd.html#systemd-multiple-mysql-instances sugere que a porta não pode ser especificada,
my.cnf
mas namysqld.service
unidade systemd.Localize o
mysqld.service
arquivo (tente/lib/systemd/system/
ou/etc/systemd/system/
) e altere a porta dentro desse arquivo conforme explicado na documentação.