真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

mysql5.7的安裝實例方法

這篇文章主要介紹“MySQL5.7的安裝實例方法”,在日常操作中,相信很多人在mysql5.7的安裝實例方法問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”mysql5.7的安裝實例方法”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

成都創(chuàng)新互聯(lián)網(wǎng)絡(luò)公司擁有10年的成都網(wǎng)站開發(fā)建設(shè)經(jīng)驗,1000+客戶的共同信賴。提供成都做網(wǎng)站、成都網(wǎng)站設(shè)計、網(wǎng)站開發(fā)、網(wǎng)站定制、賣友情鏈接、建網(wǎng)站、網(wǎng)站搭建、響應(yīng)式網(wǎng)站開發(fā)、網(wǎng)頁設(shè)計師打造企業(yè)風(fēng)格,提供周到的售前咨詢和貼心的售后服務(wù)

實例一

[root@localhost ~]# /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/3306/data

2017-03-03T07:04:07.762686Z 1 [Note] A temporary password is generated for root@localhost: uE70uYprtw?d

[root@localhost ~]# vi /data/3306/my.cnf

[client]

port = 3306

socket = /data/3306/soket/mysql.sock

[mysql]

no-auto-rehash

[mysqld]

server-id = 1

user = mysql

port = 3306

socket = /data/3306/soket/mysql.sock

basedir = /usr/local/mysql

datadir = /data/3306/data

open_files_limit    = 10240

back_log = 600

max_connections = 3000

max_connect_errors = 6000

table_open_cache = 614

external-locking = FALSE

max_allowed_packet = 32M

thread_cache_size = 300

query_cache_size = 64M

query_cache_limit = 4M

default-storage-engine = InnoDB

thread_stack = 192K

transaction_isolation = READ-COMMITTED

tmp_table_size = 256M

max_heap_table_size = 256M

long_query_time = 4

slow_query_log_file=/data/3306/logs/slow-log.log

slow_query_log

log-bin = /data/3306/logs/ray-bin.log

binlog_cache_size = 4M

max_binlog_cache_size = 8M

max_binlog_size = 512M

expire_logs_days = 7

key_buffer_size = 256MB

read_buffer_size = 1M

read_rnd_buffer_size = 16M

bulk_insert_buffer_size = 64M

skip-name-resolve

lower_case_table_names = 1

innodb_buffer_pool_size = 512M

innodb_thread_concurrency = 8

innodb_flush_log_at_trx_commit = 2

innodb_log_buffer_size = 16M

innodb_log_file_size = 128M

innodb_log_files_in_group = 3

innodb_max_dirty_pages_pct = 90

innodb_lock_wait_timeout = 120

innodb_file_per_table = on

[mysqldump]

quick

max_allowed_packet = 32M

[mysqld_safe]

log-error=/data/3306/logs/mysql_ray.err

pid-file=/data/3306/logs/ray.pid

/usr/local/mysql/bin/mysqld_safe --defaults-file=/data/3306/my.cnf 2>&1 > /dev/null &

/usr/local/mysql/bin/mysql -uroot -puE70uYprtw?d -S /data/3306/soket/mysql.sock

mysql> set password = password('123456');

mysql> flush privileges;

啟動腳本:

[root@localhost ~]# vi /data/3306/mysqld

#!/bin/bash

mysql_port=3306

mysql_username="root"

mysql_password="123456"

function_start_mysql()

{

printf "Starting MySQL...\n"

/bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/${mysql_port}/my.cnf 2>&1 > /dev/null &

}

function_stop_mysql()

{

printf "Stoping MySQL...\n"

/usr/local/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /data/${mysql_port}/soket/mysql.sock shutdown

}

function_restart_mysql()

{

printf "Restarting MySQL...\n"

function_stop_mysql

function_start_mysql

}

function_kill_mysql()

{

kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')

kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')

}

case $1 in

start)

function_start_mysql;;

stop)

function_stop_mysql;;

kill)

function_kill_mysql;;

restart)

function_stop_mysql

function_start_mysql;;

*)

echo "Usage: /data/${mysql_port}/mysqld {start|stop|restart|kill}";;

esac

實例二

[root@localhost ~]# /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/3307/data

2017-03-03T07:30:47.741108Z 1 [Note] A temporary password is generated for root@localhost: (+9QZ2l

[root@localhost ~]# cp /data/3306/my.cnf /data/3307/

[root@localhost ~]# cp /data/3306/mysqld /data/3307/

[root@localhost ~]# vi /data/3307/my.cnf 把3306替換3307

[root@localhost ~]# vi /data/3307/mysqld 把3306替換3307

[root@localhost ~]# chown mysql:mysql /data/3307/my.cnf

[root@localhost ~]# chown mysql:mysql /data/3307/mysqld

[root@localhost ~]# /data/3307/mysqld start

[root@localhost ~]# /usr/local/mysql/bin/mysql -uroot -p(+9QZ2l

mysql> set password = password('123456');

mysql> flush privileges;

到此,關(guān)于“mysql5.7的安裝實例方法”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
分享題目:mysql5.7的安裝實例方法
標(biāo)題來源:http://weahome.cn/article/gjeddj.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部