实现MySQL数据库同步实例演示_MySQL
本次实验的主要目的是剖析配置MySQL(和PHP搭配之最佳组合) 数据库的主辅MySQL数据库同步的实际操作步骤,我前两天在相关网站看见的资料,觉得挺好,就拿出来供大家分享,开始具体的配置。
本次试验的MySQL(和PHP搭配之最佳组合)版本都是 4.1.7-standard-log , master 端的操作系统是 redhat 9.0 , slave 端的操作系统是 redhat 7.3.
1.修改 master 端的my.cnf,增加配置参数:
[MySQL(和PHP搭配之最佳组合)]
log-bin
server-id=1
2. 修改 slave 端的my.cnf,增加配置参数:
log-bin
mastermaster-host=master
master-user=rep
master-password=rep
master-port=3306
server-id=2
以上参数都是最基本的配置,就不多解释了,解下来势初始化数据.
1.清空 master 上的所有 binlog,如果现存的 binlog有用的话,请先备份起来;接着把 master 上的所有数据文件打包,包括ibdata那些文件.
2.类似的方法清空 slave 上的所有 binlog,将 master上的数据文件压缩包拷贝到自身的数据文件目录下.
启动master,新增一个rep用户
" grant all privileges on *.* to rep@% identified by 'rep'; flush privileges
启动slave,检测MySQL数据库同步是否成功.
一般情况下,不成功的原因是slave连接上master之后定位binlog失败,这就需要将双方的binlog都设置成一致,然后stop slave; start slave; 即可.
以上的相关内容就是对MySQL数据库同步实例的介绍,望你能有所收获。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Which ASUS motherboard should be paired with the R55600? The ASUS ROGStrixB550-FGaming motherboard is an excellent choice. It is perfectly compatible with Ryzen55600X processor and provides excellent performance and features. This motherboard has a reliable power supply system, can support overclocking, and provides a wealth of expansion slots and ports to meet daily use and gaming needs. ROGStrixB550-FGaming is also equipped with high-quality audio solutions, fast network connections and reliable heat dissipation design to ensure that the system remains efficient and stable. In addition, this motherboard adopts a gorgeous ROG style and is equipped with gorgeous RGB lighting effects, adding visual enjoyment to your computer. All in all, ASUS ROGStri

In the staggered battle lines, players can form various lineups according to their own preferences and strategies. The game provides many options, and players can think of many different matching plans. The specific matching plan for the t0 lineup will be shared with everyone later. If you want to know more, stay tuned. Staggered front t0 lineup matching plan 1. Excellent cutting-edge 1. Roles: Rex, Styx, Queen Bee, Sandfly 2. Prioritize the lineup, which can attack and defend. Styx serves as the output core of the team, and the formation can increase damage and critical hits . 2. Intelligent support 1. Roles: Conductor, Lin, Blade Butterfly, March 2. The conductor serves as the core of the team's output, which can increase the attack speed bonus for the team, restore blood to teammates, and ensure the output environment of the front row.

Recently, high-performance thin and light notebooks have been emerging in the notebook industry, and a new round of competition has begun among major brands. For consumers, high-performance thin and light notebooks perfectly combine performance and portability, highlighting users’ ultimate needs for notebooks. Among them, professional performance thin and light notebooks represented by ROG Phantom Air took the lead in launching the show. It is reported that this time ROG brings two products, Magic 16Air and Magic 14Air, which use Intel Core Ultra9185H processor and AMDR98945HS processor respectively. They also use NVIDIA GeForceRTX independent graphics cards, both in terms of performance and portability. A satisfactory answer. What is the specific configuration? Let's take a look. Of course, before introducing performance

What games can be played with i34150 with 1G independent graphics? Can it play small games such as LoL? GTX750 and GTX750TI are very suitable graphics card choices. If you just play some small games or not play games, it is recommended to use the i34150 integrated graphics card. Generally speaking, the price difference between graphics cards and processors is not very big, so it is important to choose a reasonable combination. If you need 2G of video memory, it is recommended to choose GTX750TI; if you only need 1G of video memory, just choose GTX750. GTX750TI can be seen as an enhanced version of GTX750, with overclocking capabilities. Which graphics card can be paired with i34150 depends on your needs. If you plan to play stand-alone games, it is recommended that you consider changing the graphics card. you can choose

In the new beginning of Legend of Sword and Fairy, each character has a unique way to control the soul, so Dugu Sword Master is no exception. The strategy for matching the soul of Dugu Sword Master is actually very simple. Here are some suggestions for players to consider. First of all, for Dugu Juggernaut, attack power is the key. Therefore, the choice of soul control should be based on increasing attack power. Recommended souls include broken souls, desolate skeletons, damage bonus effect souls, etc. Secondly, considering that Dugu Juggernaut needs to maintain high output, it is also important to increase the critical hit rate. You can choose souls that increase the critical hit rate in the soul control effect, such as Needle Girl, Clam Spirit, etc. In addition, the Legend of Sword and Fairy: A New Beginning is a good match for Dugu Sword Master Yuhun. Dugu Sword Master is suitable for matching Lucky Cat Yuhun. This Yuhun provides initial attack power while maintaining the continued attack of the will-o'-the-wisp, suitable for when needed

Golang and big data: a perfect match or at odds? With the rapid development of big data technology, more and more companies are beginning to optimize business and decision-making through data analysis. For big data processing, efficient programming languages are crucial. Among many programming languages, Golang (Go language) has become one of the popular choices for big data processing due to its concurrency, efficiency, simplicity and other characteristics. So, are Golang and big data a perfect match or contradictory? This article will start from the application of Golang in big data processing,

How about pairing 13600kf with Gigabyte b760? 1. The combination effect is good. 2. Because the 13600kf is a high-performance processor from Intel, and the Gigabyte b760 is a motherboard with stable performance, the combination of the two can give full play to the performance of the processor and provide a smooth computing and gaming experience. 3. In addition, Gigabyte b760 also has good scalability and stability, and can support the connection and operation of a variety of hardware devices, providing users with more choices and convenience. Therefore, pairing 13600kf and Gigabyte b760 can not only meet users' needs for high-performance computing and games, but also have good stability and reliability. It is a relatively good choice to pair with 13600kf and Gigabyte b760. 13600kf is a cost-effective

Bai Jing Corridor is a real-time strategy two-dimensional war chess game with fully voiced and excellent gameplay. There are a variety of lineups and gameplay styles in the game, among which the Fire Thunder Team is very popular among players. Players are also very curious about the branding combination of the Fire Thunder Team. This issue will bring you the Fire Thunder Team Brand Matching Guide to help players make better configurations. White Thorn Corridor Fire Thunder Team Brand Matching Guide [Afterglow] Incentive Skill "Weakness Mark", [Become a Thousand Cranes] Incentive Skill "Fire Crit", [Sky Trap] Incentive Skill "Blazing Life", Fire Thunder will give priority to borrowing one [Sunset Elegy] inspires the skill "Power Surge" or [Dark Alley Paint Shadow] inspires the skill "Strength in Numbers". Mo Hongxiu uses [Codename Baicao] to inspire the skill "Barrier. Flame", and Long Qing needs [Nightmare] to inspire. Skill "Barrier. Water"
