資源描述:
《centos6.2編譯安裝mysql5.5.25a》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫。
1、centos6.2編譯安裝mysql-5.5.25a(傻瓜版)想在linux上安裝個mysql5.5.25a網(wǎng)上找了一堆資料,就是安裝不好,后來看到lavafree的博客上的文章,整理出100%成功的傻瓜安裝方法1.安裝準(zhǔn)備l安裝系統(tǒng):centos6.2-x86_64l安裝軟件:mysql-5.5.25al需要環(huán)境:gcc,cmake,bison,ncurses2.開始安裝2.1.安裝gcc,ncursesyum-yinstallgcc-c++yum-yinstallncurses-devel2.2下載cmake,biso,h
2、ttp://kuai.xunlei.com/d/QDMXLCVGJKAF下載解壓后有三個文件,上傳到系統(tǒng)opt目錄下安裝cmakecd/opttarzxvfcmake-2.8.8.tar.gzcdcmake-2.8.8./bootstrap========滾====屏====處====理========gmake========滾====屏====處====理========gmakeinstall========滾====屏====處====理========安裝bisoncd/opttarzxvfbison-2.5.tar
3、.gzcdbison-2.5./configure========滾====屏====處====理========make========滾====屏====處====理========makeinstall========滾====屏====處====理========完成后如下圖安裝mysql1.添加mysql賬戶/usr/sbin/groupaddmysql/usr/sbin/useradd-gmysqlmysql2.解壓cd/opt/tarzxvfmysql-5.5.25a.tar.gzcdmysql-5.5.25a/
4、3.編譯cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DMYSQL_UNIX_ADDR=/tmp/mysql.sock-DDEFAULT_CHARSET=gbk-DDEFAULT_COLLATION=gbk_chinese_ci-DWITH_EXTRA_CHARSETS:STRING=gbk,gb2312,utf8-DWITH_MYISAM_STORAGE_ENGINE=1-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_READLINE=1
5、-DENABLED_LOCAL_INFILE=1-DMYSQL_DATADIR=/opt/mysql/data========滾====屏====處====理========make========滾====屏====處====理========makeinstall========滾====屏====處====理========4.設(shè)置權(quán)限增加文件夾chmod+w/usr/local/mysqlchown-Rmysql:mysql/usr/local/mysqlmkdir-p/opt/mysql/data/mkdir-p
6、/opt/mysql/log/chown-Rmysql:mysql/opt/mysql/5.拷貝my.cnd文件(一定要根據(jù)自己的內(nèi)存拷貝這個配置文件,否則mysql無法啟動)#my-small.cnf(內(nèi)存<=64M)#my-medium.cnf(內(nèi)存128M)#my-large.cnf(內(nèi)存512M)#my-huge.cnf(內(nèi)存1G-2G)#my-innodb-heavy-4G.cnf(內(nèi)存4GB)我的內(nèi)存是1.5G,所以我拷貝my-huge.cnfcdsupport-files/cpmy-huge.cnf/etc/my
7、.cnfcpmysql.server/etc/init.d/mysqld6.初始化安裝/usr/local/mysql/scripts/mysql_install_db--defaults-file=/opt/mysql/my.cnf--basedir=/usr/local/mysql--datadir=/opt/mysql/data--user=mysql7.編輯啟動文件vi/etc/init.d/mysqldbasedir=/usr/local/mysqldatadir=/opt/mysql/datachmod+x
8、/etc/init.d/mysqld到這里mysql已經(jīng)安裝完成了servicemysqldstart看看后續(xù)處理1.加入開機(jī)啟動chkconfig--addmysqldchkconfig--level345mysqldon2.修改root密碼mysqladmin-uroot