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

溫馨提示×

溫馨提示×

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

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

Mysql8.0.18如何屬性源碼編譯安裝和gcc-9.2.0升級

發布時間:2021-11-02 17:09:01 來源:億速云 閱讀:148 作者:小新 欄目:MySQL數據庫

這篇文章將為大家詳細講解有關Mysql8.0.18如何屬性源碼編譯安裝和gcc-9.2.0升級,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。

1、環境設置

[root@centos1 opt]# vim /etc/selinux/config
SELINUX=disabled

2、用戶新增目錄設置

[root@centos1 opt]# id mysqlid: mysql: no such user
[root@centos1 opt]#  groupadd -g 101 mysql
[root@centos1 opt]# useradd -u 514 -g mysql -G root -d /home/mysql  -m mysql
[root@centos1 opt]# passwd mysqlChanging password for user mysql.New password:
Retype new password: passwd: all authentication tokens updated successfully.
[root@centos1 opt]# id mysqluid=514(mysql) gid=101(mysql) groups=101(mysql),0(root)
[root@centos1 opt]# mkdir -p /usr/local/mysql
[root@centos1 opt]# chown -R mysql.mysql /usr/local/mysql
[root@centos1 opt]# su - mysql Last login: Fri Oct 25 16:18:20 CST 2019 on pts/0
[mysql@centos1 ~]$ vi .bash_profile
PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/mysql
[root@centos1 ~]# mkdir -p /data/mysql/data
[root@centos1 ~]# mkdir -p /data/mysql/log
[root@centos1 ~]# mkdir -p /data/mysql/rum
[root@centos1 ~]# mv /data/mysql/rum /data/mysql/run
[root@centos1 ~]# mkdir -p /data/mysql/tmp
[root@centos1 local]# chown -R 755 /usr/local/mysql

3、解壓安裝包mysql-8.0.18.tar.gz  到 /opt/mysql8

4、安裝依賴
yum install -y gcc gcc-c++ ncurses-devel bison zlib libxml openssl
更新cmake3 通過Yum 安裝
yum install cmake3

安裝后發現編譯不通過 需要更新gcc版本5 以上

5、gcc-9.2.0編譯安裝

轉載: https://www.2cto.com/net/201908/815589.html

安裝gcc 源碼編譯依賴

## 先編譯gmp->mpfr->mpc
cd  /usr/local/src/
編譯: gmp-6.1.2
tar -xvf gmp-6.1.2.tar.xz
cd gmp-6.1.2
./configure --prefix=/usr/local/gmp-6.1.2
make -j $(nproc)
make install
cd ../
編譯:mpfr-4.0.2
tar -xvf mpfr-4.0.2.tar.gz
cd mpfr-4.0.2
./configure --prefix=/usr/local/mpfr-4.0.2 --with-gmp=/usr/local/gmp-6.1.2
make -j $(nproc)
make install
cd ../
編譯:mpc-1.1.0
tar -xvf mpc-1.1.0.tar.gz
cd mpc-1.1.0
./configure --prefix=/usr/local/mpc-1.1.0 --with-mpfr=/usr/local/mpfr-4.0.2  --with-gmp=/usr/local/gmp-6.1.2
make -j $(nproc)
make install
# 把mpfr lib 加入 ld.so.conf 不然gcc 編譯報錯
echo /usr/local/mpfr-4.0.2/lib  >> /etc/ld.so.conf
ldconfig

編譯安裝gcc

cd /usr/local/src/
tar -xvf gcc-9.2.0.tar.gz
cd gcc-9.2.0
./configure --prefix=/usr/local/gcc-9.2.0 \
                  -enable-threads=posix \
                  -disable-checking \
                  -disable-multilib \
                  -enable-languages=c,c++ \
                  --with-gmp=/usr/local/gmp-6.1.2 \
                  --with-mpfr=/usr/local/mpfr-4.0.2 \
                  --with-mpc=/usr/local/mpc-1.1.0 \
                  --with-tune=generic \
                  --with-arch_32=x86-64
make -j $(nproc)
make install -j $(nproc)
##備份舊 gcc 可執行文件
 mv /usr/bin/gcc /usr/bin/gcc.old
 mv /usr/bin/g++ /usr/bin/g++.old
 mv /usr/bin/c++ /usr/bin/c++.old
 mv /usr/bin/cpp /usr/bin/cpp.old
 mv /usr/bin/gcov /usr/bin/gcov.old
 ## 創建最新gcc 執行文件軟鏈
 ln -sf /usr/local/gcc-9.2.0/bin/* /usr/bin/
 ## 刪除lib64 目錄下.py 文件不然ldconfig 報錯
 rm -rf /usr/local/gcc-9.2.0/lib64/libstdc++.so.6.0.27-gdb.py
 echo /usr/local/gcc-9.2.0/lib64 >> /etc/ld.so.conf
ldconfig
## 復制libstdc++.so.6.0.27  /lib64/
cp /usr/local/gcc-9.2.0/lib64/libstdc++.so.6.0.27 /lib64/
# 創建軟鏈 libstdc++.so.6
cd /lib64
ln  -sf libstdc++.so.6.0.27 libstdc++.so.6
## 查看是否最新版本
strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX

6、cmake編譯mysql

(由于裝了不同的版本gcc,編譯時可以通過參數指定版本****重要!*****)

cmake3 \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNODB_MEMCACHED=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DCOMPILATION_COMMENT="nancy edition" \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/data/mysql/tmp \
-DMYSQL_UNIX_ADDR=/data/mysql/run/mysql.sock \
-DMYSQL_TCP_PORT=3306 \
-DSYSCONFDIR=/data/mysql \
-DWITH_READLINE=1 \
-DFORCE_INSOURCE_BUILD=1 \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DCMAKE_CXX_COMPILER=/usr/local/gcc-9.2.0/bin/g++ \
-DCMAKE_C_COMPILER=/usr/local/gcc-9.2.0/bin/gcc

編譯結束:

-- CMAKE_EXE_LINKER_FLAGS -- CMAKE_MODULE_LINKER_FLAGS -- CMAKE_SHARED_LINKER_FLAGS -- Configuring done-- Generating doneCMake Warning:  Manually-specified variables were not used by the project:
    EXTRA_CHARSETS
-- Build files have been written to: /opt/mysql8

同目錄下執行安裝創建目錄:

gmake -j $(nproc)gmake install -j $(nproc)
編譯成功:
Scanning dependencies of target mysqld[100%] Building CXX object sql/CMakeFiles/mysqld.dir/main.cc.oScanning dependencies of target pfs_connect_attr-t[100%] Linking CXX executable ../runtime_output_directory/mysqld[100%] Building CXX object storage/perfschema/unittest/CMakeFiles/pfs_connect_attr-t.dir/pfs_connect_attr-t.cc.o[100%] Building CXX object storage/perfschema/unittest/CMakeFiles/pfs_connect_attr-t.dir/__/__/__/sql/sql_builtin.cc.o[100%] Linking CXX executable ../../../runtime_output_directory/pfs_connect_attr-t[100%] Built target mysqld[100%] Built target pfs_connect_attr-t[root@centos1 mysql8]#

查看目錄:

[root@centos1 mysql]# ll
total 932
drwxr-xr-x  2 root root   4096 Oct 30 14:54 bin
drwxr-xr-x  2 root root     86 Oct 30 14:54 docs
drwxr-xr-x  3 root root    282 Oct 30 14:53 include
drwxr-xr-x  6 root root   4096 Oct 30 14:54 lib
-rw-r--r--  1 root root 408918 Sep 20 16:30 LICENSE
-rw-r--r--  1 root root 102977 Sep 20 16:30 LICENSE.router
-rw-r--r--  1 root root 408918 Sep 20 16:30 LICENSE-test
drwxr-xr-x  4 root root     30 Oct 30 14:54 man
drwxr-xr-x 10 root root   4096 Oct 30 14:54 mysql-test
-rw-r--r--  1 root root    687 Sep 20 16:30 README
-rw-r--r--  1 root root    700 Sep 20 16:30 README.router
-rw-r--r--  1 root root    687 Sep 20 16:30 README-test
drwxrwxr-x  2 root root      6 Oct 30 14:54 run
drwxr-xr-x 28 root root   4096 Oct 30 14:54 share
drwxr-xr-x  2 root root     77 Oct 30 14:54 support-files
drwxr-xr-x  3 root root     17 Oct 30 14:54 var

7、設置Mysql用戶系統參數

[root@localhost cmake-3.0.1]# vi /etc/security/limits.conf
mysql soft nproc 65536
mysql hard nproc 65536
mysql soft nofile 65536
mysql hard nofile 65536

8、配置啟動文件

[root@centos1 support-files]# echo export PATH=$PATH:/usr/local/mysql/bin >>/etc/profile
[root@centos1 support-files]# echo /usr/local/mysql/lib >> /etc/ld.so.conf
[root@centos1 support-files]# ldconfig

# 復制啟動文件

[root@centos1 support-files]# cp mysql.server  /etc/init.d/mysqld
[root@centos1 support-files]# chmod 700 /etc/init.d/mysqld
[mysql@centos1 mysql]$ vi /data/mysql/my.cnf

[client]
port = 3306
socket = /data/mysql/run/mysql.sock
# The MySQL server
[mysqld]
port = 3306
user = mysql
socket = /data/mysql/run/mysql.sock
pid_file = /data/mysql/mysqld.pid
basedir = /usr/local/mysql
datadir = /data/mysql/data
tmpdir = /data/mysql/tmp
open_files_limit = 65535
explicit_defaults_for_timestamp
server_id = 1
lower_case_table_names = 1
character_set_server = utf8
#sql_mode=STRICT_TRANS_TABLES
#
# ******security
safe_user_create
max_connections = 3000
max_user_connections=2980
secure_file_priv=/data/mysql/tmp

max_connect_errors = 100000
interactive_timeout = 86400
wait_timeout = 86400
sync_binlog=100
back_log=1024
max_binlog_cache_size=2147483648
max_binlog_size=524288000
default_storage_engine = InnoDB
log_slave_updates = 1

#*********** Logs related settings ***********
log_bin = /data/mysql/binlog/mysql-bin
[mysql@centos1 mysql]$ more /date/mysql/my.cnf
/date/mysql/my.cnf: No such file or directory
[mysql@centos1 mysql]$ more /data/mysql/my.cnf
[client]
port = 3306
socket = /data/mysql/run/mysql.sock
# The MySQL server
[mysqld]
port = 3306
user = mysql
socket = /data/mysql/run/mysql.sock
pid_file = /data/mysql/mysqld.pid
basedir = /usr/local/mysql
datadir = /data/mysql/data
tmpdir = /data/mysql/tmp
open_files_limit = 65535
explicit_defaults_for_timestamp
server_id = 1
lower_case_table_names = 1
character_set_server = utf8
#sql_mode=STRICT_TRANS_TABLES
#
# ******security
safe_user_create
max_connections = 3000
max_user_connections=2980
secure_file_priv=/data/mysql/tmp

max_connect_errors = 100000
interactive_timeout = 86400
wait_timeout = 86400
sync_binlog=100
back_log=1024
max_binlog_cache_size=2147483648
max_binlog_size=524288000
default_storage_engine = InnoDB
log_slave_updates = 1

#*********** Logs related settings ***********
log_bin = /data/mysql/binlog/mysql-bin
binlog_format= mixed
binlog_cache_size=32m
max_binlog_cache_size=64m
max_binlog_size=512m
long_query_time = 1
log_output = FILE
log_error = /data/mysql/mysql-error.log
slow_query_log = 1
slow_query_log_file = /data/mysql/slow_statement.log
log_queries_not_using_indexes=0
log_slave_updates=ON
log_slow_admin_statements=1
general_log = 0
general_log_file = /data/mysql/general_statement.log
binlog_expire_logs_seconds = 1728000
relay_log = /data/mysql/binlog/relay-bin
relay_log_index = /data/mysql/binlog/relay-bin.index
#****** MySQL Replication New Feature*********
master_info_repository=TABLE
relay-log-info-repository=TABLE
relay-log-recovery
#*********** INNODB Specific options ***********
innodb_buffer_pool_size = 4096M
transaction_isolation=REPEATABLE-READ
innodb_buffer_pool_instances = 8
innodb_file_per_table = 1
innodb_data_home_dir = /data/mysql/innodb_ts
innodb_data_file_path = ibdata1:2048M:autoextend
innodb_thread_concurrency = 8
innodb_log_buffer_size = 67108864
innodb_log_file_size = 1048576000
innodb_log_files_in_group = 4
innodb_max_undo_log_size=4G
innodb_undo_directory=/data/mysql/undo_space


innodb_log_group_home_dir = /data/mysql/innodb_log
innodb_adaptive_flushing=ON
innodb_flush_log_at_trx_commit = 2
innodb_max_dirty_pages_pct = 60
innodb_open_files=60000
innodb_purge_threads=1
innodb_read_io_threads=4
innodb_stats_on_metadata=OFF
innodb_flush_method=O_DIRECT
[mysql]
no-auto-rehash
default-character-set=UTF8MB4
#prompt = (\u@\h) [\d]>\_
net-buffer-length=64K
unbuffered
max-allowed-packet = 2G

#some var for mysql8
#log_error_verbosity=3
#innodb_print_ddl_logs=1
#binlog_expire_logs_seconds=259200
#innodb_dedicate_server=0
#
#innodb_status_file=1
#innodb_status_output=0
#innodb_status_output_locks=0

[mysqldump]
quick
max_allowed_packet=2G
log_error=/data/mysql/log/mysqld/dump.log
net_buffer_length=8k


9、初始化

$/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/my.cnf --initialize --user=mysql

查看初始化日志及密碼

[mysql@centos1 mysql]$ vi mysql-error.log

2019-10-31T03:30:00.222973Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: j63rKGLr3j-L

10、啟動mysql服務
$/usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql/my.cnf --user=mysql &

登錄

[mysql@centos1 bin]$ mysql -uroot -pj63rKGLr3j-L
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.18

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> show variable

ALTER USER 'root'@'localhost' IDENTIFIED WITH sha256_password BY 'mysqlWAI' PASSWORD EXPIRE INTERVAL 360 DAY;


關閉數據庫
[mysql@centos1 bin]$ mysqladmin -uroot -pmysqlWAI --socket=/data/mysql/run/mysql.sock shutdown &

完成!

關于“Mysql8.0.18如何屬性源碼編譯安裝和gcc-9.2.0升級”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。

向AI問一下細節

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

AI

阿巴嘎旗| 芜湖市| 定西市| 新干县| 乃东县| 武山县| 仪陇县| 姜堰市| 隆尧县| 榕江县| 卢湾区| 清涧县| 晋江市| 定结县| 遵义市| 靖边县| 游戏| 龙井市| 关岭| 垣曲县| 闻喜县| 常山县| 张掖市| 弥渡县| 买车| 化德县| 洛阳市| 淮阳县| 碌曲县| 徐汇区| 高尔夫| 尼勒克县| 车致| 遵义县| 秭归县| 嘉善县| 怀柔区| 扬州市| 临夏县| 鄢陵县| 探索|