Ubuntu13.10編譯安裝MySQL5.6

1.下載MySQL5.6源碼包 mysql


2.解壓 tar -zxvf mysql*****.tar.gz 壓縮包與tar後的文件不要放在一個目錄中 sql


3.複製文件到 /usr/local/mysql

    cp -vRp mysql*** /usr/local/mysql ui


4.添加mysql組 groupadd mysql 加密


5.添加mysql用戶 useradd -r -g mysql mysql es5


6.安裝gcc

    sudo apt-get install build-essential gcc g++ libncurses5-dev spa


7.安裝Bison

    sudo apt-get install Bison server


8.cmake
    若是須要從新cmake,則須要刪除以前生產的CMakeCache.txt
    cmake 
    -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
    -DMYSQL_DATADIR=/usr/local/mysql/data \
    -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \
    -DDEFAULT_CHARSET=utf8 \
    -DDEFAULT_COLLATION=utf8_general_ci \
    -DEXTRA_CHARSETS=all
    -DWITH_MYISAM_STORAGE_ENGINE=1 \
    -DWITH_INNOBASE_STORAGE_ENGINE=1 \
    -DENABLED_LOCAL_INFILE=1 \

    -DENABLE_DOWNLOADS=1 ip


9.make ci


10.make install get


11.設置MySQL安裝目錄權限 chown -R mysql:mysql /usr/local/mysql


12.查看scripts/mysql_install_db的權限 ls -l scripts/mysql_install_db

若是沒有x權限,則 chmod +x /usr/local/mysql/scripts/mysql_install_db

13.初始化MySQL scripts/mysql_install_db --user=mysql


14.複製權限文件 cp support-files/mysql.server /etc/init.d/mysqld


15.重命名權限文件 mv /etc/init.d/mysqld/mysql.server /etc/init.d/mysqld/mysqld.server


16.修改MySQL安裝目錄權限 chown -R root /usr/local/mysql


17.修改mysql/data目錄權限 chown -R mysql /usr/local/mysql/data


18.啓動MySQL bin/mysqld_safe --user=mysql &


19.進入mysql bin/mysql -u root


20.給root用戶添加密碼 bin/mysqladmin -u root password 'root'


21.複製my.cnf配置文件 cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf

相關文章
相關標籤/搜索