A collection of common errors after MySQL compilation installation

Source: Internet
Author: User
Tags file permissions

1.ERROR (HY000): Lost connection to MySQL server at ' reading initial communication packet ', System error:0

Tcpwarpper blocked, edit/etc/hosts.allow, plus these two lines

#/etc/Hosts.allowsshd:ALL:ALLOWmysql:ALL:ALLOW

This error also has the possibility to delete all the MySQL account, the workaround see 4


2.mysql ERROR 2002 (HY000): Can ' t connect to. /tmp/mysql.sock

PS -a| grep MySQL

and kill the process.

/var/lib/mysql all file permissions to Mysql.mysql

The problem with MySQL cannot be connected via Mysql.sock The main hint is that you cannot connect to the server via '/tmp/mysql.sock ', while the PHP standard configuration is using '/tmp/mysql.sock ', but some MySQL installation methods will Mysql.sock put in/var/lib/mysql.sock or somewhere else, you can modify the/etc/my.cnf file to fix it, open the file, you can see the following:

Change it, but it will also cause other problems, such as the MySQL program is not connected, add a bit:

Or you can also modify the configuration in the php.ini to make PHP with the other mysql.sock to connect, this everyone to find
Or in such a way:

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

Success, that's it ln-s/var/lib/mysql/mysql.sock/tmp/mysql.sock


3. './mysql-bin.index ' not Found (errcode:13) workaround

Database Directory Permissions Issues


4. The installation script removes all MySQL account solutions

Modify your My.ini or my.cnf file and add the following line under the [mysqld] section

Then save and restart the MySQL service. Below you will be able to log into the database with any user name password.

(1) If the root user is deleted by mistake, use the following statement to create the root user:

Insert  into User SetHost='localhost',User='Root', Password=Password ('954270'), Select_priv='y', Insert_priv='y', Update_priv='y', Alter_priv='y', Delete_priv='y', Create_priv='y', Drop_priv='y', Reload_priv='y', Shutdown_priv='y', Process_priv='y', File_priv='y', Grant_priv='y', References_priv='y', Index_priv='y', Create_user_priv='y', Show_db_priv='y', Super_priv='y', Create_tmp_table_priv='y', Lock_tables_priv='y', Execute_priv='y', Repl_slave_priv='y', Repl_client_priv='y', Create_view_priv='y', Show_view_priv='y', Create_routine_priv='y', Alter_routine_priv='y';

(2) If you have forgotten the root user's password, use the following statement to modify the root password:

Update User Set Password=Password ('954270'whereUser= ' Root ';

A collection of common errors after MySQL compilation installation

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.