다음 명령을 사용하여 Oracle Linux 7에 mysql-community-server 8.0을 설치했습니다.공식 문서
설치에 성공했지만 다음과 같습니다.
# service mysqld start
결과 :
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
mysql-community-server의 구성 파일이 경로에 있음을 발견했습니다 /etc/my.cnf
. 그러나 포트 설정에 대한 정보는 포함되어 있지 않습니다. /etc/my.cnf.d/
폴더가 비어 있습니다.
포트를 어떻게 변경할 수 있나요?
답변1
https://dev.mysql.com/doc/refman/8.0/en/using-systemd.html#systemd-multiple-mysql-instances포트가 systemd 단위에 지정되지 않을 수 있지만 systemd 단위에 지정 my.cnf
되어 있음을 나타냅니다.mysqld.service
파일을 찾고 mysqld.service
( /lib/systemd/system/
또는 시도 /etc/systemd/system/
) 설명서에 설명된 대로 파일 내의 포트를 변경합니다.