1.Linux下編譯安裝MySQL問(wèn)題:
(1) ../depcomp: line 571: exec: g++: not found
make[1]: *** [my_new.o] 錯(cuò)誤 127
make[1]: Leaving directory `/home/justme/software/mysql-5.1.30/mysys'
make: *** [all-recursive] 錯(cuò)誤 1-
這個(gè)問(wèn)題原因是缺少g++編譯器,解決方法是安裝gcc-c++-4.1.2-33.i386.rpm套件。在安裝過(guò)程中可能其還需要依賴(lài)套件libstdc++-devel-3.4.6-3.1.i386.rpm。所以解決途徑為:
一) 先安裝libstdc++-devel-3.4.6-3.1.i386.rpm
二) 再安裝gcc-c++-4.1.2-33.i386.rpm
(2) error: redeclaration of C++ built-in type
出現(xiàn)該問(wèn)題的原因是重新安裝gcc-c++后沒(méi)有重新執(zhí)行.configure命令。因此解決途徑為:
一) 重新執(zhí)行 ./configure –prefix=/usr/local/mysql
二) 再執(zhí)行make
(3) 啟動(dòng)MySQL時(shí)報(bào)錯(cuò):
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
這個(gè)錯(cuò)誤的原因是用mysql用戶(hù)去啟動(dòng),但是查看下var/mysql 下plugin表的所有者是root,故沒(méi)有權(quán)限去執(zhí)行。執(zhí)行chown -R mysql var可以解決問(wèn)題。
附:編譯安裝MySQL的步驟
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> bin/mysqld_safe --user=mysql &
將mysql的執(zhí)行路徑添加到root用戶(hù)的環(huán)境變量中:
shell> vi ~/.bash_profile
修改PATH變量:
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin/
讓修改馬上生效,可以執(zhí)行如下命令:source ~/.bash_profile(或者. ~/.bash_profile)
本文出自:億恩科技【mszdt.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|