Ubuntu操作系統(tǒng)下安裝MySQL數(shù)據(jù)庫的方法

字號:

安裝版本mysql-5.0.40 需編譯
    下載編譯需要的一些工具,這些工具在默認(rèn)安裝的ubuntu上可能沒有,需要手動安裝
    sudo apt-get install g++ gcc make automake perl
    安裝好所有需要的工具
    下載需要的libncurses5-dev、kdelibs_dev 和 kdelib
    sudo apt-get update
    apt-get install build-essential
    sudo apt-get install libncurses5-dev
    sudo apt-get install kdelibs4-dev
    sudo apt-get install kdelibs4c2a
    安裝mysql,使用root權(quán)限
    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 &