无法启用 mysqld 服务,但重启后该服务在 centos 7 上运行

无法启用 mysqld 服务,但重启后该服务在 centos 7 上运行

安装后,我运行systemctl enable mysqld.service。然后,输出是:

Failed to execute operation: Too many levels of symbolic links

出现此错误后,我重新启动服务,并检查 mysqld.service 的状态。systemctl status mysqld.service -l

输出为

● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Tue 2017-05-16 13:41:06 UTC; 8min ago
  Process: 1930 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 767 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 743 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 813 (mysqld)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/mariadb.service
           └─813 /usr/sbin/mysqld

May 16 13:41:05 hostname mysqld[813]: 2017-05-16 13:41:05 140294373226752 [Note] InnoDB: Highest supported file format is Barracuda.
May 16 13:41:06 hostname mysqld[813]: 2017-05-16 13:41:06 140294373226752 [Note] InnoDB: 128 rollback segment(s) are active.
May 16 13:41:06 hostname mysqld[813]: 2017-05-16 13:41:06 140294373226752 [Note] InnoDB: Waiting for purge to start
May 16 13:41:06 hostname mysqld[813]: 2017-05-16 13:41:06 140294373226752 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.35-80.0 started; log sequence number 1616859
May 16 13:41:06 hostname mysqld[813]: 2017-05-16 13:41:06 140293647075072 [Note] InnoDB: Dumping buffer pool(s) not yet started
May 16 13:41:06 hostname mysqld[813]: 2017-05-16 13:41:06 140294373226752 [Note] Plugin 'FEEDBACK' is disabled.
May 16 13:41:06 hostname mysqld[813]: 2017-05-16 13:41:06 140294373226752 [Note] Server socket created on IP: '::'.
May 16 13:41:06 hostname mysqld[813]: 2017-05-16 13:41:06 140294373226752 [Note] /usr/sbin/mysqld: ready for connections.
May 16 13:41:06 hostname mysqld[813]: Version: '10.1.23-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
May 16 13:41:06 hostname systemd[1]: Started MariaDB database server.

有什么办法可以解决这个问题吗?

谢谢!

答案1

删除mysqld.service符号链接/etc/systemd/system并再次启用mysqld.service

rm /etc/systemd/system/mysqld.service
systemctl enable mysqld.service

相关内容