源碼搭建mysql

來源:互聯網
上載者:User

標籤:mysql

源碼安裝mysql

1.說明

新版本mysql現在不需要編譯安裝,直接使用tar包裡面的設定檔即可,所以我們這裡介紹如何調用裡面設定檔,使下載的mysql源碼能夠安裝使用。

2.解壓安裝mysql

2.1解壓mysql

[[email protected]_dev02 ~]# tar xzvfmysql-5.6.23-linux-glibc2.5-x86_64.tar.gz

[[email protected]_dev02 ~]# groupadd mysql          

[[email protected]_dev02 ~]# useradd -M -s /sbin/nologin -gmysql mysql

[[email protected]_dev02 ~]# chown -R mysql.mysql/data/intall/mysql

2.2 複製設定檔

[[email protected]_dev02 mysql-5.6.23]# cpsupport-files/mysql.server /etc/init.d/mysqld

[[email protected]_dev02 mysql-5.6.23]# chmod +x/etc/init.d/mysqld

[[email protected]_dev02 mysql-5.6.23]# chkconfig --addmysqld

2.3 修改設定檔

[[email protected]_dev02 mysql-5.6.23]# vim /etc/my.cnf

[[email protected]_dev02 mysql-5.6.23]# mkdir /var/data

[[email protected]_dev02 mysql-5.6.23]# chown -R mysql.mysql/var/data

2.4對mysql的標頭檔、庫檔案做軟連結

[[email protected]_dev02 mysql-5.6.23]# ln -s/data/intall/mysql/bin/* /usr/bin/

[[email protected]ei_dev02 mysql-5.6.23]# ln -s /data/intall/mysql/lib/*/lib64/

[[email protected]_dev02 mysql-5.6.23]# ln -s/data/intall/mysql/include/mysql/* /usr/include/

2.5 初始化資料庫

預設的初始化資料庫使用的是修改前的my.cnf,所以我們要指定一下我們修改後的my.cnf

[[email protected]_dev02 mysql]# scripts/mysql_install_db--basedir=/data/install/mysql/ --datadir=/var/data --defaults-file=/etc/my.cnf--user=mysql

3.啟動mysql

[[email protected]_dev02 mysql]# mysqld_safe--defaults-file=/etc/my.cnf &


源碼搭建mysql

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.