您好,登錄后才能下訂單哦!
1、安裝環境
2、安裝依賴
3、創建用戶
4、編譯安裝
5、數據庫初始化
6、修改環境變量
1、 安裝環境
CentOS Linux release 7.2.1511?
安裝目錄/application/
安裝方式:編譯安裝
安裝mysql版本:mysql-5.7.9
2、 安裝依賴
1)安裝依賴及工具
yum?-y?install?make?gcc-c++?cmake?bison-devel??ncurses-devel?perl?vim?wget
2)安裝boost
下載安裝boost:
wget?-c?https://jaist.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz?-P?/tools mkdir?-p?/usr/local/boost cp?/tools/boost_1_59_0.tar.gz?/usr/local/boost
3、創建用戶
useradd??mysql?-s??/sbin/nologin?-M
4、安裝mysql
下載mysql
wget??-c?https://downloads.mysql.com/archives/get/file/mysql-5.7.9.tar.gz?-P?/tools? cd?/tools/?&&?tar?-xf?mysql-5.7.9.tar.gz cd?mysql-5.7.9
編譯安裝
cmake?-DCMAKE_INSTALL_PREFIX=/application/mysql-5.7.9?-DMYSQL_DATADIR=/application/mysql-5.7.9/data?-DSYSCONFDIR=/etc?-DWITH_MYISAM_STORAGE_ENGINE=1?-DWITH_INNOBASE_STORAGE_ENGINE=1?-DWITH_MEMORY_STORAGE_ENGINE=1?-DWITH_READLINE=1?-DMYSQL_UNIX_ADDR=/tmp/mysql.sock?-DMYSQL_TCP_PORT=3306?-DENABLED_LOCAL_INFILE=1?-DWITH_PARTITION_STORAGE_ENGINE=1?-DEXTRA_CHARSETS=all?-DDEFAULT_CHARSET=utf8?-DDEFAULT_COLLATION=utf8_general_ci?-DWITH_BOOST=/usr/local/boost make?&&?make?install? chown?-R?mysql:mysql?/application/mysql-5.7.9???#修改權屬
5、數據庫初始化
cp?support-files/my-default.cnf??/etc/my.cnf????????#修改配置文件 cat>/etc/my.cnf<<EOF #?For?advice?on?how?to?change?settings?please?see #?http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html #?***?DO?NOT?EDIT?THIS?FILE.?It's?a?template?which?will?be?copied?to?the #?***?default?location?during?install,?and?will?be?replaced?if?you #?***?upgrade?to?a?newer?version?of?MySQL. [mysqld] #?Remove?leading?#?and?set?to?the?amount?of?RAM?for?the?most?important?data #?cache?in?MySQL.?Start?at?70%?of?total?RAM?for?dedicated?server,?else?10%. #?innodb_buffer_pool_size?=?128M #?Remove?leading?#?to?turn?on?a?very?important?data?integrity?option:?logging #?changes?to?the?binary?log?between?backups. #?log_bin #?These?are?commonly?set,?remove?the?#?and?set?as?required. #?basedir?=?..... #?datadir?=?..... #?port?=?..... #?server_id?=?..... #?socket?=?..... basedir?=?/application/mysql-5.7.9 datadir?=?/application/mysql-5.7.9/data port?=?3306 server_id?=?1 socket?=?/tmp/mysql.sock #?Remove?leading?#?to?set?options?mainly?useful?for?reporting?servers. #?The?server?defaults?are?faster?for?transactions?and?fast?SELECTs. #?Adjust?sizes?as?needed,?experiment?to?find?the?optimal?values. #?join_buffer_size?=?128M #?sort_buffer_size?=?2M #?read_rnd_buffer_size?=?2M EOF cd?/application/mysql-5.7.9 bin/mysqld?--initialize?--user=mysql?--datadir=/application/mysql-5.7.9/data?????????#初始化 support-files/mysql.server?start?????????????????????????????????????????????????????#啟動mysql ln?-s?/application/mysql-5.7.9/?/application/mysql
6、修改環境變量
echo?'#mysql'>>/etc/profile echo?'PATH=${PATH}:/application/mysql/bin'>>/etc/profile source?/etc/profile
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。