1.下載二進制文件并解壓文件:
在富陽等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都網(wǎng)站設(shè)計、成都網(wǎng)站制作 網(wǎng)站設(shè)計制作按需求定制設(shè)計,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站設(shè)計,成都全網(wǎng)營銷推廣,成都外貿(mào)網(wǎng)站建設(shè)公司,富陽網(wǎng)站建設(shè)費用合理。
下載地址:https://dev.MySQL.com/downloads/mysql/5.7.html#downloads
tar xvzf mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.23-linux-glibc2.12-x86_64 /usr/local/
cd /usr/local/
ln -s mysql-5.7.23-linux-glibc2.12-x86_64 mysql
chown -R mysql:mysql /usr/local/mysql/
vim /etc/my.cnf
######################mysql5.7.23###############
[client]
port=3306
socket=/app/data/run/mysql.sock
[mysql]
#pid_file=/app/data/run/mysqld.pid
[mysqld]
gtid_mode=on
enforce_gtid_consistency=on
log_slave_updates=on
autocommit=1
general_log=off
explicit_defaults_for_timestamp=true
###character
default-storage-engine=INNODB
innodb_file_per_table=1
character-set-server=utf8
collation-server=utf8_general_ci
interactive_timeout = 559200
wait_timeout = 559200
# system
basedir=/usr/local/mysql
datadir=/app/data/data
max_allowed_packet=1g
max_connections=3000
max_user_connections=2800
open_files_limit=65535
pid_file=/app/data/run/mysqld.pid
port=3306
server_id=52160
#skip_name_resolve=ON
socket=/app/data/run/mysql.sock
tmpdir=/app/data/tmp
#innodb
innodb_data_home_dir=/app/data/log/iblog
innodb_log_group_home_dir=/app/data/log/iblog
innodb_buffer_pool_size = 1000M
#binlog
log_bin=/app/data/log/binlog/binlog
binlog_format=row
expire_logs_days=7
innodb_log_file_size = 200M
innodb_log_files_in_group = 4
max_binlog_size=200M
#logging
log_error=/app/data/log/error.log
slow_query_log_file=/app/data/log/slow.log
log_queries_not_using_indexes=0
slow_query_log=1
log_slave_updates=ON
log_slow_admin_statements=1
long_query_time=1
#relay
relay_log=/app/data/log/relaylog
relay_log_index=/app/data/log/relay.index
relay_log_info_file=/app/data/log/relay-log.info
[mysqld_safe]
datadir=/app/data/data
################mysql5.7.23##############
--添加用戶:
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
---
或者直接:
useradd mysql
cp -a /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
--創(chuàng)建數(shù)據(jù)目錄:
mkdir -p /app/data/log
mkdir -p /app/data/log/binlog
mkdir -p /app/data/run
mkdir -p /app/data/tmp
mkdir -p /app/data/log/iblog
chown? -R mysql:mysql /app/data/
--初始化數(shù)據(jù)庫:
[root@test1 ~]# su - mysql
[mysql@test1 ~]$?? /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --initialize --user=mysql
2.1 通腳本啟動:
啟動數(shù)據(jù)庫:
[mysql@test1 log]$ /etc/init.d/mysqld start
Starting MySQL..?????????????????????????????????????????? [? OK? ]
關(guān)閉數(shù)據(jù)庫:
[mysql@test1 log]$ /etc/init.d/mysqld stop
Shutting down MySQL..????????????????????????????????????? [? OK? ]
登錄數(shù)據(jù)庫:
[mysql@test1 log]$ /usr/local/mysql/bin/mysql -uroot -p
修改密碼:
mysql> alter user root@'localhost' identified by 'MYsql#123';
Query OK, 0 rows affected (0.00 sec)
2.2 自定義配置文件啟動:
啟動數(shù)據(jù)庫:
[mysql@test1 log]$ /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql &
關(guān)閉數(shù)據(jù)庫:
[mysql@test1 log]$ /usr/local/mysql/bin/mysqladmin? --port=3306 shutdown -p
Enter password:
3.開機自動啟動:
[root@test1 ~]# chkconfig mysqld on
新聞名稱:mysql二進制文件安裝
URL分享:http://jinyejixie.com/article32/ghhhpc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、軟件開發(fā)、用戶體驗、營銷型網(wǎng)站建設(shè)、微信小程序、手機網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)