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

主頁 > 知識庫 > CentOS 7.2 Yum編譯安裝MySQL 5.6

CentOS 7.2 Yum編譯安裝MySQL 5.6

熱門標簽:安陽手機自動外呼系統原理是什么 外呼系統線路經常出問題嗎 西藏地圖標注改進點 地圖標注專員入駐 地圖標注百度競價 地圖標注什么軟件好用 外呼系統怎樣才能不封號 神行者百貨商場地圖標注 如何辦理400客服電話

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

配置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
# 加載環境變量
[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
# 設置mysql開機自啟動
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端:備份數據庫

[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的數值和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 # 備份數據庫
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各版本安裝教程

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

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

標簽:酒泉 貴港 阜陽 萍鄉 衡水 張掖 AXB 雞西

巨人網絡通訊聲明:本文標題《CentOS 7.2 Yum編譯安裝MySQL 5.6》,本文關鍵詞  CentOS,7.2,Yum,編譯,安裝,MySQL,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《CentOS 7.2 Yum編譯安裝MySQL 5.6》相關的同類信息!
  • 本頁收集關于CentOS 7.2 Yum編譯安裝MySQL 5.6的相關信息資訊供網民參考!
  • 推薦文章
    婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av
    国产乱子伦视频一区二区三区| 国产乱一区二区| 国产伦精一区二区三区| 一区二区三区精品在线观看| 99热精品国产| 中文字幕二三区不卡| 91超碰这里只有精品国产| 欧美国产视频在线| 国产在线不卡一卡二卡三卡四卡| 日韩欧美一级精品久久| 国产精品综合一区二区| 亚洲免费观看高清在线观看| 欧美综合亚洲图片综合区| 日日欢夜夜爽一区| 色综合久久综合网| 亚洲第一福利视频在线| 26uuuu精品一区二区| fc2成人免费人成在线观看播放| 亚洲免费观看高清完整版在线观看熊 | 欧美在线免费视屏| 亚洲美腿欧美偷拍| 精品国产凹凸成av人导航| 懂色av一区二区在线播放| 国产乱码精品一区二区三区忘忧草| 欧美一区二区三区在线| 欧美人与性动xxxx| 色偷偷久久人人79超碰人人澡| 99久久99精品久久久久久| a级精品国产片在线观看| 91久久免费观看| 欧美人与z0zoxxxx视频| 国产99精品国产| 国产精品美女久久久久aⅴ| 色综合欧美在线视频区| 91免费国产在线观看| 麻豆91在线播放| 国内久久精品视频| 国产自产v一区二区三区c| 亚洲欧洲av在线| 欧美日韩中文精品| 精品国产乱码91久久久久久网站| 日本一区二区在线不卡| 亚洲小说欧美激情另类| 日韩一级片在线观看| 日韩在线播放一区二区| 欧美一区二区三区免费在线看| 免费在线看一区| 日韩在线一二三区| 国产1区2区3区精品美女| 高清国产一区二区| 欧美日韩第一区日日骚| 色综合天天做天天爱| 91视频xxxx| 欧美日韩精品三区| 国产精品久久久久影视| 一区二区三区欧美亚洲| 无吗不卡中文字幕| 国产最新精品精品你懂的| 午夜精品免费在线观看| 一区二区三区鲁丝不卡| 亚洲国产人成综合网站| 黄色成人免费在线| 色屁屁一区二区| 欧美猛男男办公室激情| 久久久精品2019中文字幕之3| 樱花草国产18久久久久| 国产一区二区免费看| 欧美在线你懂得| 国产精品国产三级国产aⅴ原创| 日本不卡一区二区| 国产成人一区二区精品非洲| 欧美在线观看禁18| 中文字幕国产一区| 欧美日韩色综合| 欧美日韩一区二区三区在线 | 成人精品在线视频观看| 久久久久久麻豆| 国产suv精品一区二区883| 欧美成人精品3d动漫h| 麻豆精品一二三| 欧美剧情电影在线观看完整版免费励志电影 | 国产精品久久网站| 亚洲v日本v欧美v久久精品| 99re热视频精品| 久久影视一区二区| 午夜久久久久久久久 | 亚洲欧美日韩国产综合在线| 日韩欧美在线123| 中文字幕一区二区三区不卡在线 | 91精品国产综合久久福利| 777奇米四色成人影色区| 日韩欧美电影一区| 久久蜜桃一区二区| 在线精品观看国产| 9久草视频在线视频精品| 日韩一区二区电影| 奇米色一区二区| 在线播放91灌醉迷j高跟美女 | 久久久蜜桃精品| 国产精品18久久久久| 国产午夜精品一区二区| av动漫一区二区| 亚洲成人一二三| 精品少妇一区二区三区日产乱码| 国产激情一区二区三区| 中文字幕一区二区三区四区| av电影在线观看一区| 日韩av不卡一区二区| 国产精品久久久一本精品| 日韩美女在线视频| 欧美在线视频你懂得| 国产精品乡下勾搭老头1| 一区二区三区免费| 7777精品伊人久久久大香线蕉的| 裸体歌舞表演一区二区| 一片黄亚洲嫩模| 亚洲一区二区欧美激情| 国产性色一区二区| 一个色妞综合视频在线观看| 一本久久精品一区二区| 成人h动漫精品| 黑人巨大精品欧美一区| 狠狠色丁香婷综合久久| 国产一区二区电影| 亚洲国产精品av| 国产精品动漫网站| 国产亚洲精品精华液| 日韩欧美自拍偷拍| 青娱乐精品视频| 久久精品这里都是精品| 99免费精品视频| 亚洲一区二区欧美日韩| 久久伊99综合婷婷久久伊| www.日韩精品| 亚洲最色的网站| 国产校园另类小说区| 久久久久久久久蜜桃| 在线观看日韩电影| 国产精品久久夜| 成人福利在线看| 国产欧美久久久精品影院| 久久久蜜臀国产一区二区| 国产一区二区三区在线观看精品| 欧美日产在线观看| 日韩二区在线观看| 日韩一卡二卡三卡四卡| 99r国产精品| 成人av资源在线| 极品销魂美女一区二区三区| 亚洲国产成人tv| 国产精品国产三级国产aⅴ无密码| 成人动漫一区二区三区| 一片黄亚洲嫩模| 久久久激情视频| 国产成人av福利| 久久国产三级精品| 国产成人av福利| 在线中文字幕一区| 91精品福利在线一区二区三区 | 欧美一二三四区在线| 国产午夜精品久久久久久久| 国产亚洲短视频| 免费观看久久久4p| 日本福利一区二区| 国产精品视频线看| 精品成人a区在线观看| 欧美激情在线观看视频免费| 亚洲精品国产高清久久伦理二区| 美女mm1313爽爽久久久蜜臀| 91在线观看下载| 久久蜜桃av一区精品变态类天堂 | 日本不卡一二三| 处破女av一区二区| 欧美日本韩国一区二区三区视频| 国产女主播视频一区二区| 亚洲国产欧美日韩另类综合| av中文字幕不卡| 日本一区二区三区国色天香 | 99久久免费精品| 日本一区二区动态图| 国产综合久久久久久鬼色| 精品久久久久久无| 日韩成人av影视| 在线日韩av片| 亚洲国产美国国产综合一区二区| 国内久久精品视频| 久久女同性恋中文字幕| 精品一区二区三区视频在线观看| 91麻豆精品国产91久久久久 | 亚洲国产精品传媒在线观看| 久久国产尿小便嘘嘘| 91精品国产综合久久久久久久久久| 综合久久久久久久| 91在线免费看| 亚洲精品高清在线| 欧美三级电影网| 捆绑调教美女网站视频一区| 欧美日韩精品一区二区三区| 日本女人一区二区三区| 精品国产一区二区三区忘忧草 |