Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Common errors in MySQL 5.6GTID

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shares with you the content of sample analysis of common errors in MySQL 5.6GTID. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

After the test environment has built a dual-host environment based on GTID, start the database to report an error:

[root@localhost ~] # service mysqld start

Starting MySQL.The server quit without updating pid [failed] usr/local/mysql/data/localhost.pid).

Check the error log / var/log/mysqld.log and find the following information:

2017-05-11 09:08:38 56355 [Note] Audit Plugin: Init completed successfully.

2017-05-11 09:08:38 56355 [ERROR]-gtid-mode=ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires-log-bin and-log-slave-updates

2017-05-11 09:08:38 56355 [ERROR] Aborting

The explanation is as follows:

The three parameters gtid_mode=ON,log_slave_updates,enforce_gtid_consistency must be configured in my.cnf at the same time. Otherwise, the following error will appear in mysql.err

2015-02-26 17:11:08 32147 [ERROR]-gtid-mode=ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires-log-bin and-log-slave-updates

2015-02-26 17:13:53 32570 [ERROR]-gtid-mode=ON or UPGRADE_STEP_1 requires-enforce-gtid-consistency

Modify / etc/my.cnf by adding the following:

Gtid-mode = on

Log-slave-updates=ON

Enforce-gtid-consistency=ON

After starting the database again, there are no more errors:

[root@localhost ~] # service mysqld start

Starting MySQL. [OK]

[root@localhost] # mysql-u mdba-p

Enter password:

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 4

Server version: 5.6.27-log Source distribution

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.

View the gtid mode:

Mysql > show global variables like'% gtid%'

+-+ +

| | Variable_name | Value |

+-+ +

| | binlog_gtid_simple_recovery | OFF |

| | enforce_gtid_consistency | ON |

| | gtid_executed |

| | gtid_mode | ON |

| | gtid_owned |

| | gtid_purged |

| | simplified_binlog_gtid_recovery | OFF |

+-+ +

7 rows in set (0.00 sec)

GTID related parameters

Parameter comment

All GTID executed by gtid_executed

GTID discarded by gtid_purged

Gtid_mode gtid mode

Gtid_next session-level variable, next gtid

Gtid that gtid_owned is running

Enforce_gtid_consistency parameters to ensure GTID security

Restrictions on GTID replication:

GTID schema instances and non-GTID schema instances cannot be replicated, and the requirements are very strict, either GTID or none.

Gtid_mode is read-only. To change the state, you must 1) close the instance, 2) modify the configuration file, 3) restart the instance

Updating transactional and non-transactional tables in the same transaction will result in multiple GTIDs being assigned to the same transaction

Cannot use CREATE TABLE... SELECT statements statement

Unable to update non-transactional storage engine in transaction

Cannot use CREATE TEMPORARY TABLE in a transaction

Thank you for reading! This is the end of this article on "sample analysis of common errors in MySQL 5.6GTID". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report