mysql源碼安裝(5.1)

來源:互聯網
上載者:User

標籤:

 

  1. 下載mysql源碼包並解壓。
    wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.73.tar.gz
    tar -zxvf mysql-5.1.73
    cd mysql-5.1.73
  2. 建立使用者、basedir datadir
    useradd -s /sbin/nologin  mysql
    mkdir -p /usr/local/mysql
    mkdir -p /data/mysql
    chown mysql /data/mysql
  3. 編譯前的參數配置
    ./configure --prefix=/usr/local/mysql
    其中有報錯資訊,需要安裝相對應的庫檔案> yum install -y gcc  yum install -y  gcc-c++   yum -y install ncurses*    yum install -y  libtermcap*
  4. 編譯 make
  5. 安裝 make install
  6. 複製mysql設定檔 cp support-files/my-medium.cnf /etc/my.cnf 
  7. 初始化資料庫   ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql/
  8. 拷貝啟動指令碼 cp support-files/mysql.server /etc/init.d/mysqld
  9. 修改許可權,並設定開機啟動。
    chmod 755 /etc/init.d/mysqld
    chkconfig --add mysqld
    chkconfig mysqld on
  10. 啟動mysql服務  /etc/init.d/mysqld start
  11. 設定mysql密碼 mysqladmin -uroot password ‘123456‘
  12. 更新環境變數
    vim /etc/profile/
    PATH=$PATH:/usr/local/mysql/bin/
    source /etc/profile/

二,安裝過程報錯資訊

hecking for termcap functions library... configure: error: No curses/termcap library found
安裝:
ncurses-devel.***.rpm 包解決
#cd /media/CentOS_5.5_Final/CentOS/
#ls ncurses-devel*
找到這個包並用rpm安裝。
# rpm -ivh ncurses-devel-5.5-24.20060715.i386.rpm
(或者去下載一個ncurses-5.6.tar.gz,
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz 解壓並安裝)

(二)
make時出錯
../depcomp: line 571: exec: g++: not found
make[1]: *** [my_new.o] 錯誤 127
make[1]: Leaving directory `/usr/local/src/mysql/mysql-5.1.73/mysys`
make: *** [all-recursive] 錯誤 1
解決:
#yum install gcc-c++ 可解決問題。
重新指定安裝路徑:
#./configure --prefix=/usr/local/mysql
make
make install
?

(三)
初始化資料庫時出錯:
# scripts/mysql_install_db --user=mysql

#bin/mysql_install_db --basedir=/usr/local/mysql-5.1.54 --datadir=/usr/local/mysql-5.1.54/data --user=mysql
[Warning] ‘--skip-locking‘ is deprecated and will be removed in a future release. Please use ‘--skip-
external-locking‘ instead.
?
(解決方案:將my.cnf 中的‘--skip-locking‘ 換成‘--skip-external-locking‘ 就可以了。)
?

 

mysql源碼安裝(5.1)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.