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

How to solve the problem of ERROR 1173 (42000) error report in MySQL

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article introduces the relevant knowledge of "how to solve the ERROR 1173 (42000) error reporting problem of MySQL". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Analysis: here is to check the error when checking connections and permissions, so find line 375 of apply_diff_relay_logs

The specific detection statements are as follows:

"$_ mysql-- user=$_escaped_slave_user-- password=$_escaped_slave_pass-- host=$opt {slave_ip}-- port=$opt {slave_port}-e\" set sql_log_bin=0; create table if not exists mysql.apply_diff_relay_logs_test (id int); insert into mysql.apply_diff_relay_logs_test values (1); update mysql.apply_diff_relay_logs_test set id=id+1 where id=1; delete from mysql.apply_diff_relay_logs_test Drop table mysql.apply_diff_relay_logs_test

The table was created and no primary key was specified

But there is no primary key to build the table should not report an error ah?

It suddenly occurred to me that the version of mariadb10.1 requires the primary key to be mandatory, so the cause of this problem is found.

MariaDB [(none)] > show variables like'% primary%'

+-+ +

| | Variable_name | Value |

+-+ +

| | innodb_force_primary_key | ON |

+-+ +

The solution (the reason has been found and everything has been solved):

1. Change the value of innodb_force_primary_key to off.

two。 Modify the detection statement of MHA, plus the primary key.

This is the end of the content of "how to solve the problem of error reporting in ERROR 1173 (42000) of MySQL". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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