91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

CentOS7.4下MySQL5.7.28源碼方式安裝

發布時間:2020-07-29 16:31:17 來源:網絡 閱讀:734 作者:夜空下微笑 欄目:MySQL數據庫

Linux系統版本:CentOS7.4
MySQL版本:5.7.28
在Linux平臺有RPM包、二進制包、源碼包3中安裝方式,這一篇文章主要是以源碼包為例來介紹如何在Linux平臺下進行MySQL的安裝。
下載地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.28.tar.gz
國內鏡像:http://mirrors.163.com/mysql/Downloads/MySQL-5.7/mysql-boost-5.7.28.tar.gz
具體安裝步驟如下:
(1)首先卸載mariadb,不然后面會和安裝mysql需要的庫沖突:

[root@localhost ~]# rpm -qa | grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64
[root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64

(2)創建mysql用戶和用戶組:

[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -r -g mysql -s /bin/false mysql

(3)創建MySQL安裝目錄和data目錄:

[root@localhost ~]# mkdir /opt/mysql
[root@localhost ~]# mkdir -p /data/mysql
[root@localhost ~]# chown  mysql:mysql /opt/mysql
[root@localhost ~]# chown  mysql:mysql /data/mysql

(4)安裝相關依賴:

[root@localhost ~]#yum install -y cmake make gcc gcc-c++ ncurses-devel  openssl-devel 

(4)編譯安裝:

[root@localhost ~]# tar -xvf mysql-boost-5.7.28.tar.gz
[root@localhost mysql-5.7.28]# cmake \
-DCMAKE_INSTALL_PREFIX=/opt/mysql \
-DMYSQL_DATADIR=/data/mysql \
-DMYSQL_USER=mysql \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 -DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/root/mysql-5.7.28/boost/boost_1_59_0/ \
-DMYSQL_DATADIR=/data/mysql \
-DWITH_SSL=system
[root@localhost ~]#make && make install

(5)初始化MySQL:

[root@localhost ~]# cd /opt/mysql/
[root@localhost mysql]# ./bin/mysqld --initialize --user=mysql --basedir=/opt/mysql --datadir=/data/mysql
2019-12-01T02:33:14.303069Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-12-01T02:33:16.484507Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-12-01T02:33:16.735058Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-12-01T02:33:16.816435Z 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: ee34514d-13e2-11ea-b534-000c29647ed4.
2019-12-01T02:33:16.818202Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-12-01T02:33:17.277339Z 0 [Warning] CA certificate ca.pem is self signed.
2019-12-01T02:33:17.415078Z 1 [Note] A temporary password is generated for root@localhost: og5Q0qgu6;Ui

生成臨時密碼為:og5Q0qgu6;Ui

(6)修改MySQL配置文件/etc/my.cnf,保存退出:

[root@localhost mysql]# vim /etc/my.cnf
[mysqld]
datadir=/data/mysql
socket=/data/mysql/mysql.sock
user=mysql
port=3306
default-storage-engine=InnoDB

[mysqld_safe]
log-error=/data/mysql/mysql-error.log
pid-file=/data/mysql/mysqld.pid

[client]
socket=/data/mysql/mysql.sock

(7)啟動MySQL:

[root@localhost mysql]# bin/mysqld_safe --user=mysql &

(8)配置環境變量:

[root@localhost ~]# vim /etc/profile
#添加下面一行
export PATH=/opt/mysql/bin:$PATH
[root@localhost ~]# source /etc/profile

(9)登錄并修改MySQL管理員密碼:

[root@localhost mysql]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.28

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> set password = PASSWORD('root123456');
Query OK, 0 rows affected, 1 warning (0.00 sec)

(10)配置原程登錄:

mysql> grant all privileges on *.* to root@'%' identified by 'root123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

霍邱县| 南宁市| 张家界市| 丹棱县| 个旧市| 成安县| 营口市| 桦甸市| 承德县| 四川省| 甘南县| 阿坝县| 大庆市| 西城区| 太湖县| 夹江县| 陵水| 灯塔市| 兰溪市| 红原县| 施甸县| 巩留县| 山西省| 视频| 康平县| 修水县| 无为县| 望江县| 邹平县| 新密市| 和龙市| 荆州市| 广灵县| 留坝县| 宁明县| 莱阳市| 宁河县| 五莲县| 保定市| 即墨市| 探索|