An error is reported in the dockerfie image, and the status is acitvating (start)

[[email protected] mysql]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: activating (start) since Thu 2021-10-14 04:26:29 UTC; 48s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 604 ExecStart=/usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 589 ExecStartPre=/usr/local/mysql/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
   CGroup: /docker/dc14736765e51e9353aa13ae33165be29c00f55a9182903933879e164fa7f8f1/system.slice/mysqld.service
           └─606 /usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid   

At the beginning of remote login, MySQL was unable to log in. I thought this state could not work normally. However, check the port. The port has also been opened

[[email protected] mysql]# netstat -natp | grep 3306
tcp6       0      0 :::3306                 :::*                    LISTEN      606/mysqld          
tcp6       0      0 172.17.0.2:3306         192.168.229.80:60618    ESTABLISHED 606/mysqld    

After repeated reinstallation, the status remains the same, but the remote login can be accessed normally, so this status does not affect the use of MySQL image container

[[email protected] mysql]# docker run --name=mysql_server1 -v /sys/fs/cgroup/:/sys/fs/cgroup -d -P --privileged mysql:centos 
fe31ead391b379516ca0ad8f3af42d72f6121a6dad90cd9c75eae3dfbe07a851
[[email protected] mysql]# docker ps -a
CONTAINER ID   IMAGE          COMMAND                  CREATED          STATUS                      PORTS                                         NAMES
fe31ead391b3   mysql:centos   "/usr/sbin/init"         5 seconds ago    Up 4 seconds                0.0.0.0:49154->3306/tcp, :::49154->3306
[[email protected] mysql]# docker exec -it fe31ead391b3 bash
[[email protected] mysql]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Thu 2021-10-14 05:14:34 UTC; 19s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 477 ExecStart=/usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
  Process: 462 ExecStartPre=/usr/local/mysql/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)

Oct 14 05:14:34 fe31ead391b3 systemd[1]: Failed to start MySQL Server.
Oct 14 05:14:34 fe31ead391b3 systemd[1]: Unit mysqld.service entered failed state.
Oct 14 05:14:34 fe31ead391b3 systemd[1]: mysqld.service failed.
Oct 14 05:14:34 fe31ead391b3 systemd[1]: mysqld.service holdoff time over, scheduling restart.
Oct 14 05:14:34 fe31ead391b3 systemd[1]: Stopped MySQL Server.
Oct 14 05:14:34 fe31ead391b3 systemd[1]: start request repeated too quickly for mysqld.service
Oct 14 05:14:34 fe31ead391b3 systemd[1]: Failed to start MySQL Server.
Oct 14 05:14:34 fe31ead391b3 systemd[1]: Unit mysqld.service entered failed state.
Oct 14 05:14:34 fe31ead391b3 systemd[1]: mysqld.service failed.
[[email protected] mysql]# systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[[email protected] mysql]# systemctl start mysqld
[[email protected] mysql]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2021-10-14 05:28:07 UTC; 35s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 745 ExecStart=/usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 730 ExecStartPre=/usr/local/mysql/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 747 (mysqld)
   CGroup: /docker/fe31ead391b379516ca0ad8f3af42d72f6121a6dad90cd9c75eae3dfbe07a851/system.slice/mysqld.service
           └─747 /usr/local/mysql/bin/mysqld --daemonize --pid-file=/usr/local/mysql/mysqld.pid

Oct 14 05:28:06 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:06.991381Z 0 [Note] Server socket created on IP: '::'.
Oct 14 05:28:06 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:06.996265Z 0 [ERROR] Can't open the mysql.func table. Please run mysql...ate it.
Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003405Z 0 [ERROR] Cannot open mysql.event
Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003442Z 0 [ERROR] Event Scheduler: An error occurred when initializ...eduler.
Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003677Z 0 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Oct 14 05:28:07 fe31ead391b3 mysqld[745]: Version: '5.7.20'  socket: '/usr/local/mysql/mysql.sock'  port: 3306  Source distribution
Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003703Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES... check.
Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.003707Z 0 [Note] Beginning of list of non-natively partitioned tables
Oct 14 05:28:07 fe31ead391b3 mysqld[745]: 2021-10-14T05:28:07.012549Z 0 [Note] End of list of non-natively partitioned tables
Oct 14 05:28:07 fe31ead391b3 systemd[1]: Started MySQL Server.
Hint: Some lines were ellipsized, use -l to show in full.


Similar Posts: