MySQL FAQ solution

Source: Internet
Author: User


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

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] Aborting

hint is The port may be occupied and executed:

greatmoo:~# netstat-anp |grep "3306"

vi/etc/my.cnf, put Port Change into 3307 :

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

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

ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (Usingpassword:no)

 
#/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 created password newpassword> 
mysql> 


Method Two:
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 passwordnewpassword>
Mysql>


/span> method Three:  
root  
# mysql-uroot-p 

Ente R password: < enter /ETC/MYSQL/DEBIAN.CNF file [client] > 

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

Start Error : File './mysql-bin.index ' not Found (errcode:13)

1 errcode mysql

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

This article from "Yun Vil Szeng" blog, reproduced please contact the author!

MySQL FAQ solution

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.