linux安裝mysql 5.5並修改其安裝路徑
檢視OS版本
[root@justin mysqldata]# more /etc/issue
Enterprise Linux Enterprise Linux AS release 4 (October Update 8)
解除安裝了已有的mysql
首先執行yum remove mysql
然後透過rpm –qa | grep mysql檢視是否還有殘餘的Mysql外掛,若有則透過以下命令刪除
[root@justin oracle]# rpm -e mysqlclient10-3.23.58-4.RHEL4.1
error: "mysqlclient10-3.23.58-4.RHEL4.1" specifies multiple packages
[root@justin oracle]# rpm -e --allmatches mysqlclient10-3.23.58-4.RHEL4.1
error: Failed dependencies:
libmysqlclient.so.10()(64bit) is needed by (installed) MyODBC-2.50.39-25.RHEL4.1.x86_64
libmysqlclient.so.10()(64bit) is needed by (installed) qt-MySQL-3.3.3-16.el4.x86_64
[root@justin oracle]# rpm -e MyODBC-2.50.39-25.RHEL4.1.x86_64
[root@justin oracle]# rpm -e qt-MySQL-3.3.3-16.el4.x86_64
[root@justin oracle]# rpm -e --allmatches mysqlclient10-3.23.58-4.RHEL4.1
[root@justin oracle]# rpm -qa | grep mysql
安裝MySQL-server-5.5.14-1.rhel5.x86_64.rpm一直報告缺失相應patch
[root@justin oracle]# rpm -ivh MySQL-server-5.5.14-1.rhel5.x86_64.rpm
warning: MySQL-server-5.5.14-1.rhel5.x86_64.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
error: Failed dependencies:
libc.so.6(GLIBC_2.4)(64bit) is needed by MySQL-server-5.5.14-1.rhel5.x86_64
rtld(GNU_HASH) is needed by MySQL-server-5.5.14-1.rhel5.x86_64
嘗試yum install libc.so.6卻又不成功,於是改為安裝MySQL-server-5.5.14-1.linux2.6.x86_64.rpm和MySQL-client-5.5.14-1.linux2.6.x86_64.rpm,然而安裝的時候卻又遇到以下錯誤。
[root@justin oracle]# rpm -ivh MySQL-server-5.1.51-1.glibc23.x86_64.rpm
warning: MySQL-server-5.1.51-1.glibc23.x86_64.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
ERROR: 1136 Column count doesn't match value count at row 1
110719 18:08:15 [ERROR] Aborting
110719 18:08:15 [Note] /usr/sbin/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in
/var/lib/mysql for more information.
You can try to start the mysqld daemon with:
shell> /usr/sbin/mysqld --skip-grant &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.
Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/bin/mysqlbug script!
費了一大堆力氣,最後找到答案,原來的mysql資訊沒有解除安裝乾淨,只需要移除/var/lib/mysql即可解決。
透過rpm –ivh 先後安裝MySQL-server-5.5.14-1.linux2.6.x86_64.rpm和MySQL-client-5.5.14-1.linux2.6.x86_64.rpm.
Mysql預設安裝路徑為根目錄,而61上的根目錄空間有限,需將其轉移的/data目錄
[root@justin oracle]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 20G 15G 4.5G 77% /
/dev/sda1 289M 25M 250M 10% /boot
/dev/sda5 681G 213G 434G 33% /data
none 63G 0 63G 0% /dev/shm
首先在/data目錄下建立名為mysqldata的目錄,然後chown –R mysql /data/mysqldata 和chgrp –R mysql /data/mysqldata 將其屬主設定成mysql
然後停止mysql服務,執行service mysql stop;
將/var/lib/mysql目錄下所有的檔案遷移到新建立的/data/myqldata下,mv /var/lib/mysql /data/mysqldata;
修改配置檔案/etc/my.conf:
#socket = /var/lib/mysql/mysql.sock—修改前
socket = /data/mysqldata/mysql/mysql.sock—修改後的值
修改/etc/rc.d/init.d/mysql:
if test -z "$datadir"
#datadir=/var/lib/mysql—修改前的值
datadir=/data/mysqldata/mysql—修改後的值
儲存並退出
此時重啟service mysql start,雖然能啟動成功,卻多出一條警告資訊
[root@justin mysqldata]# service mysql start
/etc/init.d/mysql: line 71: /data/mysqldata/mysql: is a directory
Starting MySQL..[ OK ]
經查實,檔案/etc/rc.d/init.d/myql中的記錄 datadir=/data/mysqldata/mysql 等號後面多出一個空格,去除即可
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15480802/viewspace-702671/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 安裝linux後修改其IPLinux
- 使用fnm安裝node,並自定義安裝路徑
- mysql5.5安裝MySql
- 安裝mysql5.5MySql
- Linux下檢視MySQL的安裝路徑LinuxMySql
- CMAKE安裝mysql5.5MySql
- Linux 安裝 mysql 5.5.8(cmake原始碼安裝mysql5.5以上版本)[轉]LinuxMySql原始碼
- 修改 Windows 98 安裝檔案路徑(轉)Windows
- CentOS 6.5下安裝MySQL 5.5CentOSMySql
- MySQL 5.5 原始碼安裝流程MySql原始碼
- 安裝MySQL8.0.x並修改密碼MySql密碼
- linux64bit下安裝mysql5.5LinuxMySql
- mysql資料庫安裝及預設儲存路徑修改方法MySql資料庫
- win10預設安裝路徑怎麼修改_win10預設安裝路徑在哪更改Win10
- 安裝編譯好的二進位制mysql並更改路徑編譯MySql
- Linux安裝解除安裝MySQLLinuxMySql
- 怎麼檢視mysql的安裝路徑MySql
- mysql5.5的原始碼安裝MySql原始碼
- win10怎麼更改預設安裝路徑_win10軟體安裝路徑在哪裡修改Win10
- linux怎樣檢視rpm安裝包的安裝路徑Linux
- linux下編譯安裝mysql5.5以上版本Linux編譯MySql
- 修改NPM全域性模式的預設安裝路徑NPM模式
- Linux下安裝、解除安裝mysqlLinuxMySql
- Window10 安裝Docker 自定義安裝路徑Docker
- Centos5.5中安裝Mysql5.5過程分享CentOSMySql
- Linux CentOS 安裝 PHP5.5 Redis XDebug Nginx MySQLLinuxCentOSPHPRedisNginxMySql
- Linux下原始碼編譯方式安裝MySQL5.5Linux原始碼編譯MySql
- postfix按指定路徑安裝
- rpm指向安裝路徑
- Linux如何檢視JDK的安裝路徑LinuxJDK
- linux下檢視java的安裝路徑LinuxJava
- 【MySQL安裝】Linux下安裝MySQL(預編譯)MySqlLinux編譯
- Linux-Ubuntu-mysql-安裝&解除安裝LinuxUbuntuMySql
- 修改Google Desktop Search安裝的預設路徑(摘)Go
- windows 安裝python後pip安裝路徑問題WindowsPython
- mysql安裝 for LinuxMySqlLinux
- linux 安裝mysqlLinuxMySql
- mysql 安裝 linuxMySqlLinux