连接mysql8.0提示认证协议失败
没有契合的数据库迁移工具,用pymysql实现一个

mysql配置主从复制基于GTIDs

妙音 posted @ 2018年11月25日 13:59 in mysql with tags mysql 主从 , 1912 阅读
 
 
用最简单的例子,教你配置基于GTIDs全局事物id的主从配置。mysql从5.7之后,增加了基于全局事务的主从复制,能够省去,log-bin主从复制找坐标的工作。
 

环境说明

 
mysql 8.0.12
 

过程说明

 
下面是两台新装的mysql启用全局事务id主从复制的过程
 
1) 启用log-bin,mysql默认是启动的不需要配置
 
2) master上创建复制用的帐号
 
3) master/slave启用gtid
 
4) slave配置master信息
 
5) slave启动复制
 
6) 检查配置是否成功
 
7) 测试效果
 

master上创建帐号用于复制

 
create user 'repl'@'%' identified by 'password';
grant replication slave on *.* to 'repl'@'%';
 

master启用gtid

#/etc/mysql/my.conf
server-id=1
gtid_mode=ON
enforce-gtid-consistency=true
 

slave启用gtid

server-id=2  #id不能重复
gtid_mode=ON
enforce-gtid-consistency=true
 
 

slave配置master信息

 
change master TO
master_host='192.168.50.111',
master_port=3307,
master_user='repl',
master_password='password',
master_auto_position=1;
 

启动slave

 
start slave
 

查看slave状态

 
#Slave_IO_Running/Slave_SQL_Running两个都是yes表示配置成功
show slave status;
 
 

测试

 
在master创建数据库,slave很快同步过来
 
 

参考来源

 
 
Avatar_small
meidir 说:
2023年12月09日 16:31

This is a good influencing take on this specific thought. I am glad you shared your thoughts as well as ideas and I find that i am in agreement. I certainly like the straightforward writing additionally , the work you’ve you spend working on this post. A great many thanks yous for that great work and great luck with your web site, I will be looking forward to new subjects in the future. 玫瑰花

 

===============

 

As I web-site possessor I believe the content material here is rattling fantastic , appreciate it for your efforts. You should keep it up forever! Good Luck. rent a car kosovo 開張花籃花牌

 

================

 

Hello. i like the way you post on your blog”  訂花推介

 

================

 

Very well-done blog. I especially appreciate content that has to do with beauty and fitness, so it’s important to me to see what you have here. Keep it up! facial exercises 網上訂花

Avatar_small
meidir 说:
2023年12月10日 14:10

Ill come back to check it again, thanks for your post. amazon

Avatar_small
meidir 说:
2023年12月27日 02:34

As I website possessor I believe the content matter here is rattling wonderful , appreciate it for your efforts. You should keep it up forever! Best of luck. universitas medan

Avatar_small
meidir 说:
2024年1月11日 18:30

There are various posts out there near this, I do believe taking there reference could experience made this spot or article really informative. That’s not me expression this information is poor quality. Simply I need to pronounce the fact that info provided here was unique, merely rebuild more near complete, supporting to former information will receive been actually good. The points you have touched listed below are really important, thus I’ll spot many of the information here to make this actually best for entirely the newbie’s here. Thank you this info. Actually helpful! Agencja Reklamowa Gdańsk

 

==============

 

Nice blog entre. I really have to say, good work. 網上訂花

 

==============

 

you employ a excellent weblog here! do you wish to develop invite posts on my weblog? 訂花推介

 

==============

 

When I visit this site there’s new things and improved will be able to study from. Haha I’ve experienced your source code too many times to master how you’re doing things so we could wear them my site. Thanks! I can teach you about methods to easy. 開張花籃花牌

 

==============

 

An interesting discussion may be worth comment. I do believe that you ought to write much more about this topic, it might certainly be a taboo subject but usually folks are too few to communicate on such topics. Yet another. Cheers 玫瑰花

 

==============

 

This is actually interesting, You’re a particularly proficient article author. I’ve registered with your feed additionally expect finding the fabulous write-ups. Furthermore, I’ve shared your internet-site with our social networks. seiko prospex

 

==============

 

oh cool, this information is really useful and definately is comment worthy! hehe. I’ll see if I can try to use some of this information for my own blog. Thanks! seiko watch bands

 

==============

 

I’m curious to find out what blog platform you are utilizing? I’m experiencing some small security issues with my latest blog and I would like to find something more safe. Do you have any solutions? seiko skx

 

==============

 

I just could not leave your web site before suggesting that I actually enjoyed the standard info an individual provide on your visitors? Is gonna be back regularly in order to check up on new posts. seiko 5 sports gmt

 

==============

 

The color of your blog is quite great. i would love to have those colors too on my blog.,*:~- 二手電腦

Avatar_small
meidir 说:
2024年1月26日 23:31

If you’re interested in having a guest blog poster please reply and let me know. I will provide unique content for your webstie, thanks. 알파벳토토

Avatar_small
sophia 说:
2024年1月30日 00:09

The platform focus is solely on cryptocurrency transactions. This means you have a variety of digital currencies to choose from when it comes to banking. Instead of traditional deposits, the site rewards you with Gold Coins and Stake Cash to enhance your gaming journey.  dublinbet

Avatar_small
meidir 说:
2024年2月16日 06:55

Your blog has the same post as another author but i like your better.*’”,: UAE

 

=============

 

When do you think this Real Estate market will go back up? Or is it still too early to tell? We are seeing a lot of housing foreclosures in Winter Springs Florida. What about you? I would love to get your feedback on this. 開張花籃花牌

 

=============

 

When visiting blogs, i always look for a very nice content like yours “    玫瑰花

 

=============

 

I am really impressed with your writing abilities neatly as with the layout on your blog. Is that this a paid subject matter or did you modify it your self? Anyway stay up the excellent high quality writing, it is uncommon to see a nice blog like this one today. 訂花

 

=============

 

Do you have a spam issue on this website; I also am a blogger, and I was wanting to know your situation; we have created some nice practices and we are looking to trade methods with others, please shoot me an email if interested. 法式花藝

 

=============

 

Terrific write-up! Thought about savored the actual scanning. I’m hoping you just read additional by you. There’s no doubt you could have wonderful awareness in addition to ability to see. My corporation is really prompted keeping this particulars. 手機回收

 

=============

 

produce,Whitened froth, rather same interest to find area, mild white over a chin, there’s magnificence that the rhythm, and then make a shout might be kinda hot. seiko prospex

 

=============

 

Wow, fantastic weblog layout! How lengthy have you been blogging for? you made blogging glance easy. The full glance of your website is excellent, neatly as the content material! seiko watch bands

 

=============

 

An impressive share, I just with all this onto a colleague who has been doing little analysis on this. And the man in reality bought me breakfast since I found it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending enough time to debate this, I feel strongly regarding it and really like reading on this topic. If you can, as you become expertise, could you mind updating your blog post with more details? It is highly ideal for me. Huge thumb up in this article! seiko skx

 

=============

 

Have you ever considered adding more videos to your blog posts to keep the readers more entertained? I mean I just read through the entire article of yours and it was quite good but since I’m more of a visual learner,I found that to be more helpful well let me know how it turns out! I love what you guys are always up too. Such clever work and reporting! Keep up the great works guys I’ve added you guys to my blogroll. This is a great article thanks for sharing this informative information.. I will visit your blog regularly for some latest post. seiko 5 sports gmt

Avatar_small
meidir 说:
2024年2月18日 22:22

There is noticeably a lot of money to understand this. I assume you have made particular nice points in functions also. WASTEWATER TREATMENT PLANT MANUFACTURER

 

 

=================

 

 

Nice post. I find out some thing much harder on distinct blogs everyday. Most commonly it is stimulating to learn content off their writers and practice a specific thing from their store. I’d opt to apply certain together with the content in my weblog whether or not you don’t mind. Natually I’ll provide link with your web blog. Thank you sharing. WATER TREATMENT PLANT MANUFACTURER

Avatar_small
MerchantNavyInfo 说:
2024年3月12日 21:19

Transactions using cryptocurrencies are the only emphasis of the platform. This implies that when it comes to banking, you have a range of digital currencies to select from.

captain salary in merchant navy

 

Avatar_small
Meidir 说:
2024年3月20日 19:20

There are a couple of fascinating points soon enough here but I don’t know if these people center to heart. There’s some validity but I am going to take hold opinion until I consider it further. Very good write-up , thanks and now we want more! Added onto FeedBurner too Download WordPress

Avatar_small
Meidir 说:
2024年3月22日 02:04

This is really interesting, You are a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your magnificent post. Also, I’ve shared your site in my social networks! 開張花籃花牌

 

======================

 

This web-site is often a walk-through its the data you wanted concerning this and didn’t know who to inquire about. Glimpse here, and you’ll undoubtedly discover it. 玫瑰花

 

======================

 

Your blog never ceases to amaze me, it is very well written and organized.”\"*”- 訂花

 

======================

 

It’s always good to see it from a different perspective My experience confirms that. I have to think about it some more. Can you expand on this? 法式花藝

 

======================

 

Thanks for another informative blog. The place else may I get that type of information written in such an ideal approach? I’ve a project that I’m simply now running on, and I’ve been on the look out for such info. iphone trade in

 

======================

 

Your understanding definitely fills a necessity. I’ve been wanting to locate this type of article and you truly came through. Can you believe that that which you have written just about accurately duplicates my own experience. seiko prospex

 

======================

 

This is the fitting weblog for anybody who desires to seek out out about this topic. You notice a lot its virtually arduous to argue with you (not that I really would want…HaHa). You undoubtedly put a new spin on a subject thats been written about for years. Nice stuff, just great! seiko watch bands

 

======================

 

The the next occasion Someone said a blog, I hope who’s doesnt disappoint me approximately this place. After all, It was my substitute for read, but I just thought youd have some thing interesting to convey. All I hear can be a handful of whining about something that you could fix when you werent too busy searching for attention. seiko skx

 

======================

 

There are a couple of interesting points soon enough in this post but I don’t know if I see these people center to heart. You can find some validity but I’ll take hold opinion until I consider it further. Good post , thanks and we want much more! Combined with FeedBurner also seiko 5 sports gmt

Avatar_small
Meidir 说:
2024年3月28日 19:54

I am thankful that I discovered this web blog , just the right information that I was searching for! .Typically, Apple announces a press event about a week in advance, and products tend to ship within a couple days to a couple weeks of that event. Tech

 

 

==================

 

 

Can I simply say what a relief to seek out somebody who actually knows what theyre speaking about on the internet. You definitely know tips on how to deliver a problem to gentle and make it important. Extra people must learn this and understand this facet of the story. I cant consider youre no more in style since you undoubtedly have the gift. Tech


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter