最近在CentOS 7上安裝Mysql時,遇到了一些依賴性錯誤。具體的報錯信息顯示我缺少了libaio庫,這是導致Mysql無法啟動的一個重要因素。
[root@localhost ~]# systemctl start mysqld.service Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details.
因此,我決定先安裝這個缺失的依賴項,命令如下:
yum install libaio
然而,這時候出現了另一個報錯,提示我缺少“libnuma.so.1”,使得依賴項安裝失敗。
Error: Package: MySQL-server-5.6.42-2.el7.x86_64 (mysql56-community) Requires: libnuma.so.1()(64bit)
于是,我需要再次安裝一個缺失的庫,在這種情況下,是“numactl-libs”,命令如下:
yum install numactl-libs
之后我再次嘗試安裝Mysql,結果成功啟動了Mysql服務。
[root@localhost ~]# systemctl start mysqld.service [root@localhost ~]# systemctl status mysqld.service ● mysqld.service - MySQL Community Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled) Active: active (running) since 三 2019-04-17 23:27:23 CST; 23s ago Main PID: 20556 (mysqld_safe) CGroup: /system.slice/mysqld.service ├─20556 /bin/sh /usr/bin/mysqld_safe --basedir=/usr └─20717 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysql/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld... 4月 17 23:27:23 localhost.localdomain mysqld_safe[20556]: 190417 23:27:23 mysqld_safe Logging to '/var/log/mysql/mysqld.log'. 4月 17 23:27:23 localhost.localdomain mysqld_safe[20556]: 190417 23:27:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 4月 17 23:27:23 localhost.localdomain systemd[1]: Started MySQL Community Server.
總之,在安裝軟件時,出現依賴性錯誤是十分常見的情況。我們可以試著查看報錯信息,找出缺失的依賴項,然后安裝它,以解決問題。