Common error resolution collection during use in MySQL

Source: Internet
Author: User
Tags flush iptables

1, Mysql Errono 1005: The primary foreign key is not exactly the same, please check the following points:

A, whether the field exists
b, the type is consistent (note unsigned, powerdesign generation problem)
C, the database engine is consistent
D, character encoding is consistent
E, the Windows platform Note modified lower_case_table_names = 0, Windows itself is not case-sensitive, to 0 after the distinction may cause the reference can not find the table

2, Mysql Errono 121: FOREIGN KEY constraint name repeat

3, record the abbreviation meaning in Mysql WorkBench:
      pk:primary key (column is part of a PK)
 &N bsp;    nn:not Null (column is nullable)
      uq:unique (column is part of A unique key
      Ai:auto increment (the column is auto incremented when rows are insert ed)
      Bin:binary (if DT is a blob or similar, this indicates the is binary data, rathe R than text)
      un:unsigned (for integer types, click Docs: "10.2. Numeric Types ")
      Zf:zero Fill (rather a display related flag, docs:" 10.2. Numeric Types ")  

4, MySQL permission settings
Add remote host access MySQL root permissions
Insert into User (Host,user,password) values ('% ', ' root ', password (' root '));
Root Rights authorization
Grant all privileges in *.* to ' root ' @ '% ' identified by ' root ' with GRANT option;
Update permission settings
Flush privileges;

5, firewall settings
Open port
/sbin/iptables-i input-p TCP--dport 3306-j ACCEPT
Save
/etc/rc.d/init.d/iptables Save
View status
/etc/init.d/iptables status

6, on the automatic operation (to achieve similar Windows services)
/sbin/chkconfig--level 2345 mysqld on
/sbin/chkconfig--list
The results are as follows:
Mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

7, Linux installed under the MySQL, not from other machines access account has been authorized to access from any host

Vi/etc/sysconfig/iptables

Add at a later

-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT

Service Iptables Restart

Find it or not.

The final discovery record is added to the

-A rh-firewall-1-input-p ICMP--icmp-type any-j ACCEPT this one before restarting OK again

8, forget the MySQL password

Microsoft Windows [version 5.2.3790]

(C) Copyright 1985-2003 Microsoft Corp.

C:documents and SETTINGSADMINISTRATOR>CD D:webwww.php100.commysqlmysql Se

Rver5.5bin

C:documents and Settingsadministrator>d:

D:webwww.php100.commysqlmysql Server5.5bin>mysql

Welcome to the MySQL Monitor. Commands End With; or G.

Your MySQL Connection ID is 1

Server version:5.5.10 MySQL Community Server (GPL)

Copyright (c), the Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark the Oracle Corporation and/or its

Affiliates. Names may trademarks of their respective

Owners.

Type ' help, ' or ' h ' for help. Type ' C ' to clear the current input statement.

mysql> use MySQL;

Database changed

mysql> Update user Set Password=password ("520") where user= "root";

Query OK, 1 row Affected (0.00 sec)

Rows matched:1 changed:1 warnings:0

mysql> flush Privileges;

Query OK, 0 rows Affected (0.00 sec)

Mysql> Q

Bye

D:webwww.php100.commysqlmysql server5.5bin>

9, MySQL 2003 error resolution

MySQL server resource is tight, causing inability to connect
 
Workaround:
1, if you are a virtual host user (purchase space), the contact space provider checks whether MySQL is normal to start, and confirm MySQL configuration information (whether localhost
2, if you are a stand-alone host user (with administrative host privileges), follow the steps below to check:
1 to check whether the MySQL service is started.
Windows Host, right click on My Computer, click Manage, find the MySQL service in the service and application to see if it is a started state.
If the error 2003:can ' t connect to MySQL server ' localhost ' (10061) appears, your MySQL has not been started.
Workaround:
First step
Delete c:windowns my.ini
Step two
Open C:mysqlbinwinmysqladmin.exe enter username and password
Third step in DOS input mysqld- Nt-remove Delete Service
Enter Mysqld-nt-install
Fourth Step into MySQL startup success

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.