安裝MySQL,linux安裝mysql

來源:互聯網
上載者:User

安裝MySQL,linux安裝mysql

因為Oracle已經收購了MySQL,所以商業版的也轉移到了edelivery.oracle.com網站上。需要的朋友可以去自行下載研究,但是要先註冊Oracle網站的帳號。

 

如果下載的是GA版本,也就是社區版,直接在http://dev.mysql.com/downloads/mysql/網站下載即可。

 

想下載老版本的MySQL,也可以在http://dev.mysql.com/downloads/mysql/網站上找到,不過只提供5.1.73以及5.5.40版本。需要的朋友可以自行下載。

 

 

注意:只提供使用rpm安裝的程式包,大家可以選擇。

RPM Bundle把MySQL相關的包都下載下來,以備不時之需。

 

 

下載上傳到mysql伺服器上面,解壓後使用rpm命令安裝即可

 

注意,mysql初始密碼在/root/.mysql_secret,很容易被忽略,大家第一次使用root使用者登陸的時候需要用到。

 

 

需要注意的是:

使用rpm安裝的後,會有mysql組以及使用者添加到作業系統上。

 

 

 

 

 

 

 

初始的檔案目錄:

 

 

 

Directory

Contents of Directory

/usr/bin

Client programs and scripts

/usr/sbin

The mysqld serverMySQL

/var/lib/mysql

Log files, databases

/usr/share/info

Manual in Info format

/usr/share/man

Unix manual pages

/usr/include/mysql

Include (header) files

/usr/lib/mysql

Libraries

/usr/share/mysql

Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation

/usr/share/sql-bench

Benchmarks

 

 

 

使用rpm安裝後,可以直接使用service mysql start 命令啟動mysql資料庫。

 

啟動後會用ps命令可以看到它的啟動選項

 

 

/usr/sbin/mysqld --basedir=/usr--datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql--log-error=/var/lib/mysql/mysql01.err --pid-file=/var/lib/mysql/mysql01.pid

 

--basedir=/usr 根目錄

--datadir=/var/lib/mysql 資料檔案存放目錄

--plugin-dir=/usr/lib/mysql/plugin 外掛程式存放目錄

--user=mysql 啟動使用者

--log-error=/var/lib/mysql/mysql01.err 錯誤記錄檔檔案path

--pid-file=/var/lib/mysql/mysql01.pid 進程id檔案存放位置

 

 

 

預設選項為上述,到/etc/init.d/mysql啟動指令碼或者my.cnf檔案中自行修改。

 

 

預設的my.cnf搜尋目錄是

$BASEDIR/my.cnf----/etc/my.cnf

相關文章

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.