婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > CentOS 7.2 Yum編譯安裝MySQL 5.6

CentOS 7.2 Yum編譯安裝MySQL 5.6

熱門標(biāo)簽:安陽(yáng)手機(jī)自動(dòng)外呼系統(tǒng)原理是什么 外呼系統(tǒng)線路經(jīng)常出問題嗎 西藏地圖標(biāo)注改進(jìn)點(diǎn) 地圖標(biāo)注專員入駐 地圖標(biāo)注百度競(jìng)價(jià) 地圖標(biāo)注什么軟件好用 外呼系統(tǒng)怎樣才能不封號(hào) 神行者百貨商場(chǎng)地圖標(biāo)注 如何辦理400客服電話

本文實(shí)例為大家分享CentOS 7.2 Yum安裝mysql5.6的方法,供大家參考,具體內(nèi)容如下

配置CentOS SCLo源

[3] 添加 CentOS SCLo Software collections Repository.
[root@linuxprobe~]# yum -y install centos-release-scl-rh centos-release-scl
# set [priority=10]
[root@linuxprobe~]# sed -i -e "s/\]$/\]\npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl.repo
[root@linuxprobe~]# sed -i -e "s/\]$/\]\npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
# for another way, change to [enabled=0] and use it only when needed
[root@linuxprobe~]# sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-SCLo-scl.repo
[root@dlp ~]# sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo

yum安裝MySQL

# 安裝mysql
[root@linuxprobe~]# yum --enablerepo=centos-sclo-rh -y install rh-mysql56-mysql-server
# 加載環(huán)境變量
[root@linuxprobe ~]# scl enable rh-mysql56 bash
[root@linuxprobe ~]# mysql -V 
mysql Ver 14.14 Distrib 5.6.26, for Linux (x86_64) using EditLine wrapper
[root@linuxprobe ~]# which mysql 
/opt/rh/rh-mysql56/root/usr/bin/mysql
# 設(shè)置mysql開機(jī)自啟動(dòng)
root@linuxprobe ~]# vi /etc/profile.d/rh-mysql56.sh
#!/bin/bash
source /opt/rh/rh-mysql56/enable
export X_SCLS="`scl enable rh-mysql56 'echo $X_SCLS'`"


[4] Enable MySQL 5.6 and Configure initial settings.
[root@linuxprobe ~]# vi /etc/opt/rh/rh-mysql56/my.cnf.d/mysql-server.cnf
# add follows within [mysqld] section
[mysqld]
character-set-server=utf8
[root@linuxprobe ~]# systemctl start rh-mysql56-mysqld
[root@linuxprobe ~]# systemctl enable rh-mysql56-mysqld
[root@linuxprobe ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
 SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
# set root password
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
# remove anonymous users
Remove anonymous users? [Y/n] y
 ... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
# disallow root login remotely
Disallow root login remotely? [Y/n] y
 ... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
# remove test database
Remove test database and access to it? [Y/n] 
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
# reload privilege tables
Reload privilege tables now? [Y/n] y
 ... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!


[root@linuxprobe ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.26 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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> select user,host,password from mysql.user; 
+------+-----------+-------------------------------------------+
| user | host | password     |
+------+-----------+-------------------------------------------+
| root | localhost | *E2ACEC2F2DA384EE6753673365DFEF35F0C272C9 |
| root | 127.0.0.1 | *E2ACEC2F2DA384EE6753673365DFEF35F0C272C9 |
| root | ::1 | *E2ACEC2F2DA384EE6753673365DFEF35F0C272C9 |
+------+-----------+-------------------------------------------+
3 rows in set (0.00 sec)
mysql> show databases; 
+--------------------+
| Database  |
+--------------------+
| information_schema |
| mysql  |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
mysql> exit
Bye


開啟防火墻

[root@linuxprobe ~]# firewall-cmd –add-service=MySQL –permanent 
success 
[root@linuxprobe ~]# firewall-cmd –reload 
success

同樣使用yum在vdevops.org上面安裝mysql,安裝步驟參考上面

MySQL 主從

Master端:linuxprobe

[root@linuxprobe~]# vi /etc/opt/rh/rh-mysql56/my.cnf.d/mysql-server.cnf
[mysqld]
# add follows in [mysqld] section : get binary logs
log-bin=mysql-bin
# define uniq server ID
server-id=101
[root@linuxprobe ~]# mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.26-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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> grant replication slave on *.* to replica@'%' identified by 'password';
Query OK, 0 rows affected (0.07 sec)
mysql> flush privileges; 
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye

開啟防火墻

[root@linuxprobe ~]# firewall-cmd –add-service=mysql –permanent 
success 
[root@linuxprobe ~]# firewall-cmd –reload 
success

Slave端:vdevops

[root@vdevops~]# vi /etc/opt/rh/rh-mysql56/my.cnf.d/mysql-server.cnf
[mysqld]
# add follows in [mysqld] section : get binary logs
log-bin=mysql-bin
# define server ID (different one from Master Host)
server-id=102
# read only
read_only=1
# define own hostname
report-host=node01.srv.world
[root@vdevops~]# systemctl restart rh-mysql56-mysqld

Master端:備份數(shù)據(jù)庫(kù)

[root@linuxprobe ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.26-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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> flush tables with read lock; # 鎖表
Query OK, 0 rows affected (0.01 sec)
mysql> show master status; #記住file的數(shù)值和position的值
+------------------+----------+--------------+------------------+-------------------+
| File  | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000001 | 400 |  |   |   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
mysql> exit
Bye
#
[root@linuxprobe ~]# mysqldump -u root -p --all-databases --lock-all-tables --events > mysql_dump.sql # 備份數(shù)據(jù)庫(kù)
Enter password: 
[root@linuxprobe ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.26-log MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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> unlock tables; # 解鎖
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@linuxprobe ~]# scp mysql_dump.sql vdevops.org@/tmp/
cp: cannot create regular file ‘vdevops.org@/tmp/': No such file or directory
[root@linuxprobe ~]# scp mysql_dump.sql vdevops.org:/tmp/
The authenticity of host 'vdevops.org (10.1.1.56)' can't be established.
ECDSA key fingerprint is f8:d2:55:54:8f:e8:43:e0:ee:aa:d6:8d:53:8c:8e:85.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'vdevops.org' (ECDSA) to the list of known hosts.
mysql_dump.sql 


Slave 端:

[root@vdevops ~]# mysql -u root -p  /tmp/mysql_dump.sql
Enter password: 
[root@vdevops ~]# mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.26-log MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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> change master to
 -> master_host='10.1.1.53', # master ip
 -> master_user='replica', # replication ID
 -> master_password='password', # replication passwd
 -> master_log_file='mysql-bin.000001', # bin-log number
 -> master_log_pos=400;  # position
Query OK, 0 rows affected, 2 warnings (0.03 sec)

mysql> start slave;
Query OK, 0 rows affected (0.01 sec)

mysql> show slave status\G
*************************** 1. row ***************************
  Slave_IO_State: Waiting for master to send event
   Master_Host: 10.1.1.53
   Master_User: replica
   Master_Port: 3306
  Connect_Retry: 60
  Master_Log_File: mysql-bin.000001
  Read_Master_Log_Pos: 475
  Relay_Log_File: mysqld-relay-bin.000002
  Relay_Log_Pos: 358
 Relay_Master_Log_File: mysql-bin.000001
  Slave_IO_Running: Yes
  Slave_SQL_Running: Yes
  Replicate_Do_DB: 
  Replicate_Ignore_DB: 
  Replicate_Do_Table: 
 Replicate_Ignore_Table: 
 Replicate_Wild_Do_Table: 
 Replicate_Wild_Ignore_Table: 
   Last_Errno: 0
   Last_Error: 
   Skip_Counter: 0
  Exec_Master_Log_Pos: 475
  Relay_Log_Space: 532
  Until_Condition: None
  Until_Log_File: 
  Until_Log_Pos: 0
  Master_SSL_Allowed: No
  Master_SSL_CA_File: 
  Master_SSL_CA_Path: 
  Master_SSL_Cert: 
  Master_SSL_Cipher: 
  Master_SSL_Key: 
 Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
  Last_IO_Errno: 0
  Last_IO_Error: 
  Last_SQL_Errno: 0
  Last_SQL_Error: 
 Replicate_Ignore_Server_Ids: 
  Master_Server_Id: 101
   Master_UUID: d47dddc3-9c70-11e6-8efb-000c29ffc05a
  Master_Info_File: /var/opt/rh/rh-mysql56/lib/mysql/master.info
   SQL_Delay: 0
  SQL_Remaining_Delay: NULL
 Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
  Master_Retry_Count: 86400
   Master_Bind: 
 Last_IO_Error_Timestamp: 
 Last_SQL_Error_Timestamp: 
  Master_SSL_Crl: 
  Master_SSL_Crlpath: 
  Retrieved_Gtid_Set: 
  Executed_Gtid_Set: 
  Auto_Position: 0
1 row in set (0.00 sec)

精彩專題分享:mysql不同版本安裝教程 mysql5.7各版本安裝教程 mysql5.6各版本安裝教程

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

您可能感興趣的文章:
  • Centos7下使用yum安裝mysql數(shù)據(jù)庫(kù)的詳細(xì)教程(增強(qiáng)版)
  • centos7 用rpm安裝mysql詳解
  • CentOS7.2虛擬機(jī)上安裝MySQL 5.6.32的教程
  • CentOS 7 x64下Apache+MySQL(Mariadb)+PHP56的安裝教程詳解
  • centos 7系統(tǒng)下編譯安裝 mysql5.7教程
  • CentOS 7 安裝 MySQL 5.6遇到的各種問題小結(jié)
  • centOS7安裝MySQL數(shù)據(jù)庫(kù)
  • Centos 6.4源碼安裝mysql-5.6.28.tar.gz教程
  • linux下源碼安裝mysql5.6.20教程
  • CentOS 6.4下編譯安裝MySQL5.6.14教程

標(biāo)簽:酒泉 貴港 阜陽(yáng) 萍鄉(xiāng) 衡水 張掖 AXB 雞西

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《CentOS 7.2 Yum編譯安裝MySQL 5.6》,本文關(guān)鍵詞  CentOS,7.2,Yum,編譯,安裝,MySQL,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《CentOS 7.2 Yum編譯安裝MySQL 5.6》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于CentOS 7.2 Yum編譯安裝MySQL 5.6的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av
    亚洲观看高清完整版在线观看 | 成人av在线播放网址| 99国产精品视频免费观看| 4438x成人网最大色成网站| 中文字幕在线观看一区二区| 六月丁香婷婷久久| 91福利社在线观看| 国产色一区二区| 久久激五月天综合精品| 在线亚洲一区观看| 国产精品麻豆久久久| 久久99精品一区二区三区三区| 色综合天天综合网天天看片| 欧美国产成人精品| 国产毛片一区二区| 精品噜噜噜噜久久久久久久久试看 | 欧美日韩大陆一区二区| 国产精品卡一卡二卡三| 久久www免费人成看片高清| 精品视频在线免费看| 一区二区三区自拍| 99精品在线免费| 中文字幕高清一区| 国产白丝网站精品污在线入口| 日韩精品一区二区三区在线播放 | 国产资源在线一区| 日韩女优av电影| 日韩电影一区二区三区| 欧美乱熟臀69xxxxxx| 亚洲第四色夜色| 欧美日韩亚洲另类| 精品一区二区在线视频| 欧美日韩精品免费| 一二三四区精品视频| 在线看日本不卡| 亚洲午夜免费电影| 欧美日韩高清一区二区| 日本亚洲一区二区| 欧美一区二区三区白人| 九九视频精品免费| 久久品道一品道久久精品| 国产不卡高清在线观看视频| 国产精品免费人成网站| 色综合天天性综合| 亚洲国产成人91porn| 欧美一区二区三区免费在线看| 久久激五月天综合精品| 国产欧美一区二区精品忘忧草| 成人国产视频在线观看| 亚洲一区二区av电影| 91精品久久久久久久91蜜桃| 国产在线日韩欧美| 中文字幕一区二区三区色视频| 在线观看一区二区视频| 奇米一区二区三区| 国产精品三级视频| 欧美亚洲丝袜传媒另类| 日本不卡视频一二三区| 亚洲国产高清aⅴ视频| 欧美在线影院一区二区| 久久99在线观看| 亚洲欧美乱综合| 欧美xxx久久| 色爱区综合激月婷婷| 理论电影国产精品| 中文字幕中文字幕中文字幕亚洲无线| 在线免费观看成人短视频| 精品亚洲成a人在线观看| 日韩伦理电影网| 欧美成人欧美edvon| 91精品福利视频| 国产一区二区在线观看视频| 亚洲综合一区二区三区| 欧美成人a∨高清免费观看| 在线中文字幕一区二区| 国内精品伊人久久久久av一坑| 亚洲精品五月天| 精品国产伦一区二区三区观看体验| 91丝袜美女网| 国产激情偷乱视频一区二区三区 | 欧美精品xxxxbbbb| 成人午夜伦理影院| 久久精品国产亚洲aⅴ| 一区二区三区四区在线播放 | 国产亚洲欧美日韩俺去了| 欧美色大人视频| 99久久777色| 国产91精品在线观看| 久久成人羞羞网站| 午夜精品久久久久| 玉足女爽爽91| 国产精品伦理在线| 久久精品一区蜜桃臀影院| 日韩欧美精品在线| 欧美精品乱码久久久久久| 91麻豆.com| 91丨九色丨蝌蚪富婆spa| 欧美性欧美巨大黑白大战| av一区二区不卡| 高清国产一区二区| 国产精品中文字幕欧美| 久久99精品国产麻豆婷婷| 日韩福利视频导航| 男男成人高潮片免费网站| 香蕉久久夜色精品国产使用方法| 亚洲美女在线国产| 亚洲欧美日韩在线播放| 日韩美女视频一区二区| 亚洲欧洲精品天堂一级| 国产精品不卡一区二区三区| 中文字幕中文在线不卡住| 国产日韩欧美a| 国产精品网站导航| 国产精品女上位| 亚洲欧美综合色| 亚洲综合一二区| 亚洲国产wwwccc36天堂| 视频在线观看91| 日韩va亚洲va欧美va久久| 免费不卡在线视频| 国产精品羞羞答答xxdd| 成人午夜激情片| 91福利在线导航| 欧美日韩国产高清一区二区三区| 91精品国产高清一区二区三区蜜臀| 91麻豆精品国产综合久久久久久| 日韩欧美中文字幕一区| 久久久久久久电影| 亚洲日本电影在线| 亚洲成人久久影院| 九九**精品视频免费播放| 国产丶欧美丶日本不卡视频| 粉嫩绯色av一区二区在线观看| 91原创在线视频| 欧美一级二级三级乱码| 久久久久久久性| 国产精品久久久久久亚洲毛片 | 亚洲成人免费看| 久久99精品久久久久久久久久久久| 九一九一国产精品| 成人短视频下载| 欧美丝袜丝nylons| 久久午夜羞羞影院免费观看| 亚洲欧美日本在线| 日韩精品免费专区| 成熟亚洲日本毛茸茸凸凹| 欧美视频第二页| 久久久久久**毛片大全| 亚洲一区二区视频在线| 国产一区二三区| 欧美系列亚洲系列| 欧美国产综合一区二区| 首页综合国产亚洲丝袜| 国产成人综合视频| 91麻豆精品国产自产在线观看一区| 国产嫩草影院久久久久| 日韩电影在线看| 97精品久久久午夜一区二区三区| 日韩一区二区影院| 一区二区三区在线观看网站| 国产一区二区三区电影在线观看| 欧美色图在线观看| 最新国产の精品合集bt伙计| 久久成人免费电影| 欧美三级在线视频| 亚洲人亚洲人成电影网站色| 久久国产麻豆精品| 欧美精品99久久久**| 亚洲区小说区图片区qvod| 国产精品一卡二卡在线观看| 日韩免费看网站| 天天操天天干天天综合网| 91色porny在线视频| 久久精品日韩一区二区三区| 老色鬼精品视频在线观看播放| 欧美在线free| 亚洲丝袜另类动漫二区| 国产成人av电影在线| 一区二区三区四区蜜桃| 成人福利在线看| 国产肉丝袜一区二区| 精品一区二区三区影院在线午夜| 欧美亚洲国产怡红院影院| 中文字幕不卡的av| 国产99久久久国产精品潘金| 久久综合久久99| 精品中文字幕一区二区小辣椒| 欧美日产国产精品| 亚洲一区在线观看视频| 91免费国产在线| 亚洲日本丝袜连裤袜办公室| 粉嫩av一区二区三区| 国产精品日韩精品欧美在线| 国产成人在线免费| 国产欧美精品在线观看| 成人av资源下载| 亚洲欧美日本韩国| 日本久久一区二区三区| 亚洲一区二区中文在线| 欧美欧美欧美欧美|