這篇文章主要為大家展示了“MySQL5.7.18 for Linux7.2如何實(shí)現(xiàn)二進(jìn)制安裝”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“MySQL5.7.18 for Linux7.2如何實(shí)現(xiàn)二進(jìn)制安裝”這篇文章吧。
為雙灤等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及雙灤網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站制作、雙灤網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!
具體的做法如下:
1、下載二進(jìn)制軟件包:
mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
2、添加MySQL用戶和組:
[root@localhost ~]# userdel mysql (因?yàn)槭切孪到y(tǒng),所以就把現(xiàn)有的MySQL用戶給刪除了)
[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -g mysql mysql
[root@localhost ~]# passwd mysql (MySQL密碼要設(shè)置的復(fù)雜一點(diǎn),或者在創(chuàng)建用戶的時(shí)候設(shè)置不讓登陸系統(tǒng))
3、創(chuàng)建安裝MySQL目標(biāo),并解壓軟件到指定目錄
[root@localhost ~]# mkdir -p /mysql/data
[root@localhost ~]# chown -R mysql.mysql /mysql
[root@localhost ~]# tar zxvf mysql-5.7.18-linux-glibc2.5-x86_64 -C /mysql
[root@localhost ~]# cd /mysql
[root@localhost ~]# mv mysql-5.7.18-linux-glibc2.5-x86_64/ mysql5718
[root@localhost ~]# chown -R mysql.mysql /mysql
4、切換MySQL用戶,并初始化數(shù)據(jù)庫
[root@localhost ~]# su - mysql
[mysql@localhost ~]$ /mysql/mysql5718/bin/mysqld --initialize --user=mysql --basedir=/mysql/mysql5718/ --datadir=/mysql/data/
-----注意,初始化數(shù)據(jù)庫會(huì)生成登錄MySQL數(shù)據(jù)庫的root密碼,一定要記住,一會(huì)登錄數(shù)據(jù)庫要用
5、編輯my.cnf配置文件,啟動(dòng)數(shù)據(jù)庫
[mysql@localhost ~]$ vim my.cnf (該配置文件僅供參考)
[client]
socket = /mysql/data/mysql.sock
default_character_set = utf8
[mysql]
socket=/mysql/data/mysql.sock
[mysqld]
server_id = 1607
port = 3306
basedir = /mysql/mysql5718/
datadir = /mysql/data/
socket = /mysql/data/mysql.sock
pid_file = /mysql/data/mysql.pid
log_error = /mysql/data/mysql_error.log
log_bin = /mysql/data/mysql_bin
relay_log = /mysql/data/relay_bin
character_set_server = utf8
collation_server = utf8_general_ci
innodb_buffer_pool_size = 8G
innodb_buffer_pool_instances = 8
innodb_log_file_size = 1G
innodb_log_files_in_group = 3
innodb_log_buffer_size = 24M
innodb_flush_log_at_trx_commit = 1
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
innodb_io_capacity = 200
innodb_io_capacity_max = 600
innodb_thread_concurrency = 0
innodb_autoinc_lock_mode = 2
innodb_lock_wait_timeout = 60
innodb_read_io_threads = 4
innodb_write_io_threads = 4
innodb_max_dirty_pages_pct = 80
innodb_autoextend_increment = 512
innodb_checksum_algorithm = NONE
innodb_doublewrite = 0
innodb_use_native_aio = 1
innodb_open_files = 8192
sync_binlog = 1
sync_relay_log = 1
relay_log_info_repository = TABLE
master_info_repository = TABLE
expire_logs_days = 10
binlog_format = ROW
transaction-isolation = READ-COMMITTED
concurrent_insert = 2
skip_slave_start = TRUE
back_log = 2000
thread_stack = 256k
thread_cache_size = 256
key_buffer_size = 256M
tmp_table_size = 64M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
sort_buffer_size = 2M
join_buffer_size = 2M
query_cache_size = 0
query_cache_type = 0
max_heap_table_size = 64M
binlog_cache_size = 2M
table_open_cache = 8192
max_allowed_packet = 64M
bulk_insert_buffer_size = 64M
max_connect_errors = 100000
max_connections = 500
connect_timeout = 300
wait_timeout = 86400
interactive_timeout = 86400
lower_case_table_names = 1
open_files_limit = 20480
skip_name_resolve
skip_external_locking
explicit_defaults_for_timestamp = TRUE
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql@localhost ~]$ /mysql/mysql5718/bin/mysqld_safe --defaults-file=/mysql/data/my.cnf --user=mysql &
6、進(jìn)入數(shù)據(jù)庫檢查:
[mysql@localhost ~]$ /mysql/mysql5718/bin/mysql -u root -p --socket=/mysql/data/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.18-log MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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='123456'; (因?yàn)閯偛攀褂玫拿艽a是個(gè)默認(rèn)的登錄密碼,所以我們要修改)
mysql> flush privileges;
然后再重新登錄MySQL即可,進(jìn)行檢查
mysql> s\
--------------
/mysql/mysql5718/bin/mysql Ver 14.14 Distrib 5.7.18, for linux-glibc2.5 (x86_64) using EditLine wrapper
Connection id: 7
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.7.18-log MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /mysql/data/mysql.sock
Uptime: 25 min 16 sec
Threads: 1 Questions: 19 Slow queries: 0 Opens: 110 Flush tables: 1 Open tables: 103 Queries per second avg: 0.012
--------------
mysql>
這樣,二進(jìn)制的MySQL就順利安裝完成了;
以上是“MySQL5.7.18 for Linux7.2如何實(shí)現(xiàn)二進(jìn)制安裝”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
新聞名稱:MySQL5.7.18forLinux7.2如何實(shí)現(xiàn)二進(jìn)制安裝
分享URL:http://chinadenli.net/article14/ihocge.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設(shè)、面包屑導(dǎo)航、手機(jī)網(wǎng)站建設(shè)、定制開發(fā)、標(biāo)簽優(yōu)化、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)