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

溫馨提示×

溫馨提示×

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

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

MySQL5.7.20安裝教程

發布時間:2020-04-25 14:47:49 來源:億速云 閱讀:270 作者:三月 欄目:MySQL數據庫

本文主要給大家介紹MySQL5.7.20安裝教程,其所涉及的東西,從理論知識來獲悉,有很多書籍、文獻可供大家參考,從現實意義角度出發,億速云累計多年的實踐經驗可分享給大家。

Source Install MySQL 5.7.20

mysql5.7版本之后要用boost1.59
http://www.boost.org/

yum -y install gcc gcc-c++ ncurses ncurses-devel cmake bison wget

wget https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz && wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.20.tar.gz

tar xf boost_1_59_0.tar.gz && tar xf mysql-boost-5.7.20.tar.gz

cd mysql-5.7.20

groupadd mysql

useradd mysql -s /bin/nologin -M -g mysql

mkdir -p /usr/local/mysql-5.7.20 /usr/local/mysql-5.7.20/data /usr/local/mysql-5.7.20/mysql.sock
MySQL5.7.20安裝教程cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.7.20  \
-DMYSQL_DATADIR=/usr/local/mysql-5.7.20/data \
-DMYSQL_UNIX_ADDR=/usr/local/mysql-5.7.20/mysql.sock \
-DSYSCONFDIR=/etc \
-DWITH_BOOST=../boost_1_59_0 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITHOUT_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FAST_MUTEXES=1 \
-DWITH_ZLIB=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_DEBUG=0

編譯安裝
make -j `grep processor /proc/cpuinfo | wc -l`
make install

設置啟動腳本,開機自啟動
ls -lrt /usr/local/mysql
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld

配置文件
/etc/my.cnf,
cat > /etc/my.cnf << EOF
[client]
port = 3306
socket = /dev/shm/mysql.sock
[mysqld]
port = 3306
socket = /dev/shm/mysql.sock
basedir = /usr/local/mysql
datadir = /data/mysql
pid-file = /data/mysql/mysql.pid
user = mysql
bind-address = 0.0.0.0
server-id = 1
init-connect = 'SET NAMES utf8mb4'
character-set-server = utf8mb4
#skip-name-resolve
#skip-networking
back_log = 300
max_connections = 1000
max_connect_errors = 6000
open_files_limit = 65535
table_open_cache = 128
max_allowed_packet = 4M
binlog_cache_size = 1M
max_heap_table_size = 8M
tmp_table_size = 16M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
sort_buffer_size = 8M
join_buffer_size = 8M
key_buffer_size = 4M
thread_cache_size = 8
query_cache_type = 1
query_cache_size = 8M
query_cache_limit = 2M
ft_min_word_len = 4
log_bin = mysql-bin
binlog_format = mixed
expire_logs_days = 30
log_error = /data/mysql/mysql-error.log
slow_query_log = 1
long_query_time = 1
slow_query_log_file = /data/mysql/mysql-slow.log
performance_schema = 0
explicit_defaults_for_timestamp
#lower_case_table_names = 1
skip-external-locking
default_storage_engine = InnoDB
#default-storage-engine = MyISAM
innodb_file_per_table = 1
innodb_open_files = 500
innodb_buffer_pool_size = 64M
innodb_write_io_threads = 4
innodb_read_io_threads = 4
innodb_thread_concurrency = 0
innodb_purge_threads = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 2M
innodb_log_file_size = 32M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
bulk_insert_buffer_size = 8M
myisam_sort_buffer_size = 8M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
interactive_timeout = 28800
wait_timeout = 28800
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M
EOF

添加mysql的環境變量
echo -e '\n\nexport PATH=/usr/local/mysql/bin:$PATH\n' >> /etc/profile && source /etc/profile

初始化數據庫
mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql

啟動數據庫

systemctl start mysqld
systemctl status mysqld

查看MySQL服務進程和端口
ps -ef | grep mysql

設置數據庫root用戶密碼
mysql_secure_installation

常用操作
將MySQL數據庫的動態鏈接庫共享至系統鏈接庫
一般MySQL數據庫還會被類似于PHP等服務調用,所以我們需要將MySQL編譯后的lib庫文件添加至當前Linux主機鏈接庫 /etc/ld.so.conf.d/
下,這樣MySQL服務就可以被其它服務調用了。
ldconfig |grep mysql
echo "/usr/local/mysql/lib" > /etc/ld.so.conf.d/mysql.conf
ldconfig
ldconfig -v |grep mysql

進入數據庫
mysql -uroot -p
show databases;
quit

看了以上MySQL5.7.20安裝教程介紹,希望能給大家在實際運用中帶來一定的幫助。本文由于篇幅有限,難免會有不足和需要補充的地方,大家可以繼續關注億速云行業資訊板塊,會定期給大家更新行業新聞和知識,如有需要更加專業的解答,可在官網聯系我們的24小時售前售后,隨時幫您解答問題的。

向AI問一下細節

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

AI

肃南| 天长市| 米林县| 崇仁县| 合川市| 莎车县| 耿马| 峨眉山市| 防城港市| 台州市| 宁化县| 辛集市| 琼结县| 西平县| 灵寿县| 铜鼓县| 涞源县| 清丰县| 天祝| 清水县| 海兴县| 潮安县| 巴马| 壶关县| 淅川县| 凌云县| 五家渠市| 玉门市| 米林县| 东城区| 武功县| 元阳县| 佛山市| 抚州市| 安平县| 沿河| 太康县| 清河县| 玉溪市| 永康市| 温泉县|