MySQL Error summary

Source: Internet
Author: User


One, ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/tmp/ Mysql.sock ' (111)

1, [[email protected] ~]# Find/-name Mysql.sock

/var/lib/mysql/mysql.sock

To create a symbolic connection:

Ln-s/var/lib/mysql/mysql.sock/tmp/mysql.sock

2, vi/etc/my.conf

Check if the downstream content exists :

[Client]

Socket=/tmp/mysql.sock


Second, MySQL I can't find them . Mysql.sock or the file is empty, view the log as follows:

[ERROR] Can ' t start server:bind on TCP/IP Port:cannot assign requested address
[ERROR] Do you already has another MYSQLD server running on port:3306?
[ERROR] The aborting // hint is that the port may be occupied and then executed:

[[email protected] ~] # netstat-anp |grep "3306"

vi /ETC/MY.CNF, port 3307 :

greatmoo:~# vi/etc/mysql/my.cnf
[Client]
Port = 3307
# ...

[mysqld]
Port = 3307
# ... ..
ready to start after savingMySQL, and then startMySQLit worked.


three , error 1045 (28000): Access Denied foruser  " Root ' @ ' localhost '   (usingpassword:no)

Method 1, #/etc/init.d/mysql stop
# Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
# mysql-u Root MySQL
mysql> UPDATE user SET Password=password (' newpassword ') whereuser= ' root ';
mysql> FLUSH privileges;
Mysql> quit
#/etc/init.d/mysql Restart
# mysql-uroot-p
Enter Password: < Enter the newly set password newpassword>
Mysql>

Method 2, direct use/etc/mysql/debian.cnfin the file[Client]section provides the user name and password:
# mysql-udebian-sys-maint-p
Enter Password: < input[Client]section's password >
mysql> UPDATE user SET Password=password (' newpassword ') whereuser= ' root ';
mysql> FLUSH privileges;
Mysql> quit
# mysql-uroot-p
Enter Password: < Enter the newly created password newpassword>
mysql>

Enter Password: < enter /ETC/MYSQL/DEBIAN.CNF [client ] The password provided by the section < Span style= "FONT-SIZE:9PT;" >>

Last note: Do not forget to turn off the firewall so that the external network cannot access the host's database port.


Four, start error : File './mysql-bin.index ' not Found (errcode:13)

1 , errcode13 mysql whether the user has write permission to all files within the database directory , check permissions

2 , chown Mysql.mysql-r < Mysql-bin.index the directory where >


Five, MySQL master/Slave Library synchronization error: 1062 Error ' Duplicate entry ' 1438019 ' for key ' PRIMARY "on query

1 , the solution is to execute from the library. :

mysql> slave stop;

Mysql> set GLOBAL sql_slave_skip_counter=1;

mysql> slave start;

2 , modify MySQL configuration file, let the synchronization thread from the library ignore this error, method:

Modify the MySQL configuration file/etc/my.cnf under [mysqld] Add a line slave_skip_errors = 1062, save. Restart MySQL. MySQL slave can be synchronized normally.


VI. mysql master/Slave Library synchronization error: Got fatalerror 1236 from master if reading data from binary log

in the Source ( master ) over there, execute:

Flush logs;
Show master status;

Write down File, Position .

in the Target (from) End, execute:

Change MASTER tomaster_log_file= ' testdbbinlog.000008 ', master_log_pos=107;
Slave start;
Show slave status \g

Everything is fine.


This article from "Yun Vil Szeng" blog, declined reprint!

MySQL Error summary

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.