mysql安裝記錄文檔

來源:互聯網
上載者:User

標籤:mysql   安裝   配置   

1、  下載mysql

http://mysql.ntu.edu.tw/pub/MySQL/Downloads/

選了5.1.70版本

mysql-5.1.70.tar.gz

2、  解壓安裝

(1)      建立使用者

useradd -s/sbin/nologin -M mysql

(2)解壓

tar zxf mysql-5.1.70.tar.gz

(3)編譯

cd mysql-5.1.70

./configure         --prefix=/application/mysq     --with-unix-socket-path=/application/mysql/tmp/mysql.sock--localstatedir=/application/mysql/data

--enable-assembler

--with-mysqld-ldflags=-all-static

--with-client-ldflags=-all-static

--enable-thread-safe-client

--with-mysqld-user=mysql

--with-big-tables

--without-debug

--with-pthread

--with-extra-charsets=all

--with-charset=utf8

--with-readline

--with-ssl

--with-embedded-server

--enable-local-infile –

-with-plugins=partition,innobase

(4)安裝

make

make install

參數說明:

--prefix=/application/mysql  安裝路徑

--with-unix-socket-path=/application/mysql/tmp/mysql.sock指定mysql socket檔案存放目錄

--localstatedir=/application/mysql/data   設定mysql的資料檔案存放位置

--enable-assembler   允許實用彙編模式(最佳化效能)

--with-mysqld-ldflags=-all-static  伺服器使用靜態庫(最佳化效能)

--with-client-ldflags=-all-static  用戶端使用靜態庫(最佳化效能)

--enable-thread-safe-client  以線程方式編譯用戶端

--with-mysqld-user=mysql  指定mysql啟動並執行系統使用者

--with-big-table  支援超過4GB的大表

--without-debug  使用非debug模式

--with-pthread  強制使用pthread線程式庫編譯

--with-extra-charsets=complex   指定安裝的字元集,如果是all就是安裝所有字元集

--with-charset=utf8   預設字元集為utf8

--with-readline   顯示安裝的編譯問題

--with-ssl  讓configure指令碼去檢測ssl庫的位置

--with-embedded-server  構建嵌入服務?

--enable-local-infile   允許本機資料檔案裝載

--with-plugins=partition,innobase   支援partition分表功能,innobase儲存引擎(innodb)

3、配置啟動

cp support-files/my-small.cnf /etc/my.cnf    拷貝設定檔

cd /application/mysql/; mkdir data   建立date目錄

chown -R mysql /application/mysql/    更改目錄擁有者

/application/mysql/bin/mysql_install_db--basedir=/application/mysql --datadir=/application/mysql/data/ --user=mysql      初始化資料庫檔案

/application/mysql/bin/mysqld_safe & 啟動mysql

echo ‘exportPATH=/application/mysql/bin:$PATH‘ >>/etc/profile

source /etc/profile    配置環境變數

cp/home/tool/mysql-5.1.70/support-files/mysql.server /etc/init.d/mysqld  拷貝開機檔案

chmod 755 /etc/init.d/mysqld   給予執行許可權

chkconfig --add mysqld

chkconfig --level 3 mysql on   添加啟動項並設定開機啟動

mysqladmin -u root password ‘123‘  更改資料庫root使用者的密碼

本文出自 “古星” 部落格,請務必保留此出處http://jjsly.blog.51cto.com/704083/1591792

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.