CentOS7安裝MySQL沖突和問題解決小結


問題1:

[root@localhost install-files]# rpm -ivh MySQL-server-5.6.27-1.el6.x86_64.rpm 
Preparing...                          ################################# [100%] 
file /usr/share/mysql/charsets/README from install of MySQL-server-5.6.27-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.41-2.el7_0.x86_64 
file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.6.27-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.41-2.el7_0.x86_64 
file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-5.6.27-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.41-2.el7_0.x86_64 file /usr/share/mysql/charsets/macce.xml from install of MySQL-server-5.6.27-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.41-2.el7_0.x86_64 file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-5.6.27-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.41-2.el7_0.x86_64 
file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.6.27-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.41-2.el7_0.x86_64 
    ……………………

解決1:

出現以上安裝錯誤列表的原因是:系統已經安裝了其他版本的mysql-libs包和mysql數據庫文件導致不兼容。

[plain] view plaincopy

  1. [root@localhost install-files]# yum remove mysql-libs 

執行之后,還要詳細檢查卸載MySQL安裝的所有文件,否則在后續安裝發生各種錯誤:CentOS下MySQL的徹底卸載

問題2:

[root@Tony_ts_tian developer]# rpm -ivh MySQL-server-5.5.46-1.el6.x86_64.rpm 
warning: MySQL-server-5.5.46-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY 
Preparing...                ########################################### [100%] 
   1:MySQL-server           ########################################### [100%]

解決2:

從 rpm版本 4.1 開始,在安裝或升級軟件包時會檢查軟件包的簽名。如果簽名校驗失敗,你就會看到類似以上的錯誤消息:

注:新的、只針對文件頭的簽名:錯誤消息:error: Header V3 DSA signature: BAD, key ID 0352860f

注:沒有安裝合適的鑰匙來校驗簽名,消息中就會包含 NOKEY:錯誤消息:warning: V3 DSA signature: NOKEY, key ID 0352860f

由於yum安裝了舊版本的GPG keys造成的,解決辦法就是(設置后無效):

[plain] view plaincopy

  1. rpm --import /etc/pki/rpm-gpg/RPM* 

此簽名是檢驗安裝包的有效性和安裝性的。我直接跳過(安裝時不校驗,加--nosignature參數)檢驗安裝:

[plain] view plaincopy

  1. [root@localhost install-files]# rpm -ivh MySQL-server-5.6.27-1.el6.x86_64.rpm --nosignature 

問題3:

mysqld: unrecognized service

[plain] view plaincopy

  1. [root@Tony_ts_tian init.d]# service mysqld start 
  2. mysqld: unrecognized service 

解決3:

啟動腳本文件mysql的目錄

[plain] view plaincopy

  1. [root@localhost install-files]# cd /etc/rc.d/init.d/ 
  2. [root@localhost init.d]# ls 
  3. functions  mysql  netconsole  network  README 

並沒有mysqld:

 

推薦:Centos7安裝MySQL常見問題

CentOS7下安裝MySQL數據庫常見問題 1. ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) 1. 檢查M

 

[plain] view plaincopy

  1. [root@Tony_ts_tian init.d]# service mysql start 

啟動成功:

也可以:

[plain] view plaincopy

  1. [root@Tony_ts_tian init.d]# mv mysql mysqld 
  2. [root@Tony_ts_tian init.d]# service mysqld start 

問題4:

[root@localhost install-files]# rpm -ivh MySQL-server-5.6.27-1.el6.x86_64.rpm --nosignature 
Preparing...                          ################################# [100%] 
Updating / installing... 
   1:MySQL-server-5.6.27-1.el6        ################################# [100%] 
warning: user mysql does not exist - using root 
warning: group mysql does not exist - using root 
FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db: 
Data::Dumper

解決4:

[plain] view plaincopy

  1. [root@localhost install-files]# yum install -y perl-Module-Install.noarch 

問題5:

[root@localhost mysql]# service mysql start 
Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

[plain] view plaincopy

  1. [root@localhost init.d]# cd /var/lib/mysql/ 
  2. [root@localhost mysql]# ll 
  3. total 110620 
  4. -rw-rw----. 1 mysql mysql       56 Oct 11 23:20 auto.cnf 
  5. -rw-rw----. 1 mysql mysql 12582912 Oct 11 23:20 ibdata1 
  6. -rw-rw----. 1 mysql mysql 50331648 Oct 11 23:20 ib_logfile0 
  7. -rw-rw----. 1 mysql mysql 50331648 Oct 11 23:19 ib_logfile1 
  8. -rw-r-----. 1 mysql root      5847 Oct 11 23:20 localhost.localdomain.err 
  9. drwx--x--x. 2 mysql mysql     4096 Oct 11 23:19 mysql 
  10. drwx------. 2 mysql mysql     4096 Oct 11 23:19 performance_schema 
  11. -rw-r--r--. 1 root  root       111 Oct 11 23:19 RPM_UPGRADE_HISTORY 
  12. -rw-r--r--. 1 mysql mysql      111 Oct 11 23:19 RPM_UPGRADE_MARKER-LAST 
  13. drwxr-xr-x. 2 mysql mysql        6 Oct 11 23:19 test 

查看路徑:mysql-bin.index多余文件,auto.cnf和performance_schema等不存在(文件不全)。(以上為成功后的mysql數據庫目錄)

解決5:

因為以前存在的MySQL卸載不干凈導致。

刪除和卸載(以下是的解決),然后重新安裝:CentOS下MySQL的徹底卸載


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM