首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 數據庫知識 >  >> MySQL 資料庫 >> MySQL 綜合教學

RPM 安裝 MySQL 衝突「conflicts with file from package mysql-libs」解決:先移除舊 libs

     編輯:MySQL 綜合教學

RPM 安裝 MySQL 衝突「conflicts with file from package mysql-libs」解決:先移除舊 libs

在 CentOS/RHEL 使用 RPM 直接安裝 MySQL 官方套件時,常遇到:

file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.61-4.el6.x86_64
file /usr/share/mysql/charsets/armscii8.xml ... conflicts with mysql-libs-5.1.61-4.el6.x86_64
...

原因:系統預裝的 mysql-libs (舊版 5.1) 佔用了 /usr/share/mysql/charsets/ 等文件,與新版 RPM 衝突。

解決步驟

  1. 移除衝突的舊版 libs (需確認版本號):
    yum -y remove mysql-libs-5.1.61*
    (-y 自動確認,避免互動提示)
  2. 重新安裝新版 RPM:
    rpm -ivh MySQL-server-5.5.32-1.el6.x86_64.rpm

安裝成功後的初始化提示

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
...

依提示執行 mysql_secure_installation 完成安全初始化 (設定 root 密碼、移除匿名用戶、禁止遠程 root、移除 test 庫)。

補充:若系統為 CentOS 7+ (預裝 mariadb-libs)

yum -y remove mariadb-libs
# 然後再安裝 MySQL 官方 RPM 或使用官方 yum repo
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved