日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
MySQL5.7.15編譯安裝
1.MySQL的編譯安裝,需要使用cmake和Boost C++庫,因此在進行安裝前,需要提前安裝好cmake及編譯器。
[root@oel6 ~]# yum -y install gcc gcc-c++ ncurses ncurses-devel cmake
2.下載MySQL源代碼,選擇下載Generic Linux (Architecture Independent), Compressed TAR Archive Includes Boost Headers版本,該版本包含boost庫信息,不需要單獨下載
[root@oel6 local]# wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.15.tar.gz
3.添加mysql用戶
[root@oel6 local]# groupadd mysql
[root@oel6 local]# useradd -r -g mysql -s /bin/nologin mysql
4.解壓MySQL安裝介質(zhì)
[root@oel6 local]# tar -zxvf mysql-boost-5.7.15.tar.gz 
[root@oel6 local]# cd mysql-5.7.15/
5.編譯安裝MySQL
[root@oel6 local]# mkdir -p /mysql/data

[root@oel6 local]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/mysql/data \
-DWITH_BOOST=/usr/local/mysql-5.7.15/boost/boost_1_59_0 \

[root@oel6 mysql-5.7.15]# make
[root@oel6 mysql-5.7.15]# make install
清除編譯錯誤信息
[root@oel6 mysql-5.7.15]# make clean
[root@oel6 mysql-5.7.15]# rm CMakeCache.txt
6.初始化MySQL數(shù)據(jù)庫
[root@oel6 ~]# cd /usr/local/mysql/
[root@oel6 mysql]# chown -R mysql:mysql ./
[root@oel6 mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/mysql/data
2016-10-06T05:11:36.422748Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-10-06T05:11:36.832157Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-10-06T05:11:36.900930Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-10-06T05:11:36.961751Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 5b4533be-8b83-11e6-927a-0800279bbbbf.
2016-10-06T05:11:36.963090Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-10-06T05:11:36.964712Z 1 [Note] A temporary password is generated for root@localhost: ;uIY2:ZVrv)u[root@oel6 mysql]# bin/mysql_ssl_rsa_setup --datadir=/mysql/data
Generating a 2048 bit RSA private key
......+++
.........................................................................................................+++
writing new private key to 'ca-key.pem'
-----
Generating a 2048 bit RSA private key
...........................+++
............................................................................................................................................................................................+++
writing new private key to 'server-key.pem'
-----
Generating a 2048 bit RSA private key
.................+++
...........................................................................................................................+++
writing new private key to 'client-key.pem'
-----
MySQL 5.7.6 之前版本,使用下面命令進行初始化
bin/mysql_install_db --user=mysql
7.啟動MySQL數(shù)據(jù)庫 (編譯安裝的MySQL,會默認創(chuàng)建/etc/my.cnf文件)
[root@oel6 ~]# cd /mysql
[root@oel6 mysql]# mkdir log
[root@oel6 mysql]# mkdir run
[root@oel6 ~]# chown -R mysql:mysql /mysql

[root@oel6 mysql]# cat /etc/my.cnf 
[mysqld]       //非默認參數(shù)會影響通過服務(wù)方式啟停數(shù)據(jù)庫datadir=/mysql/data
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe][root@oel6 mysql]# bin/mysqld_safe --user=mysql &
[1] 27572
[root@oel6 mysql]# 2016-10-06T05:21:00.684235Z mysqld_safe Logging to '/mysql/log/mysqld.log'.
2016-10-06T05:21:00.709272Z mysqld_safe Starting mysqld daemon with databases from /mysql/data
8.登陸MySQL數(shù)據(jù)庫
[root@oel6 ~]# vi /root/.bash_profile 
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin //環(huán)境變量中增加mysql的路徑[root@oel6 ~]# . /root/.bash_profile 

[root@oel6 mysql]# mysql -u root -h localhost -p
Enter password: ;uIY2:ZVrv)uWelcome to the MySQL monitor.  Commands end with ; or \g.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'oracle';
9.配置MySQL服務(wù)自啟動
[root@oel6 ~]# cd /usr/local/mysql
[root@oel6 mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@oel6 mysql]# chkconfig --add mysqld
[root@oel6 mysql]# chkconfig --list mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
10.關(guān)閉MySQL數(shù)據(jù)庫
[root@oel6 bin]# mysqladmin -u root shutdown
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
[root@oel6 bin]# mysqladmin -u root -p shutdown
Enter password: 
2016-10-06T05:50:46.469848Z mysqld_safe mysqld from pid file /mysql/run/mysqld.pid ended
[1]+  Done                    mysqld_safe --user=mysql
11.通過服務(wù)進行MySQL啟停
[root@oel6 bin]# service mysqld start
Starting MySQL.                                            [  OK  ]
[root@oel6 bin]# service mysqld stop
Shutting down MySQL.                                       [  OK  ]
12.登陸非默認端口MySQL
[root@oel6 bin]# mysql -u root -P8000 -h localhost -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.

名稱欄目:MySQL5.7.15編譯安裝
分享地址:http://www.dlmjj.cn/article/ipeiog.html