Summary of common error analysis and solution methods for MySQL

Source: Internet
Author: User
Tags file copy mysql client phpmyadmin server memory

One, Can ' t connect to MySQL server on ' localhost ' (10061)?


Translator: Can't connect to MySQL on localhost? Analysis: This indicates that the "localhost" computer is present, but the MySQL service is not available on this machine. Need to start the MySQL service on this machine, if the load is too high, the corresponding request will also produce this error. Solution: Since it is not activated then go to start the machine MySQL. If the startup is unsuccessful, the majority is due to a problem with your my.ini configuration. Reconfigure it.? If you feel the MySQL load is abnormal, you can go to the Mysql/bin directory to perform mysqladmin-uroot-p123 processlist to see the current MySQL process.

Second, Unknown MySQL serverhost ' localhosadst ' (11001)

?

Translator: unknown MySQL server LOCALHOSADST? Analysis: Server LOCALHOSASDST does not exist. Or can't connect at all? Resolution: Double check your forum below./config.inc. php found $dbhost reset to the correct MySQL server address.

third, Access denied for user: ' [email protected] ' (Using password:yes)


Translator: User Roota access localhost is denied (not allowed to pass)? Analysis: Causes this error general database user name and password relative to MySQL server is incorrect? Resolution: Double check your forum below./config.inc.php Find $dbuser, $ DBPW after verification, reset save.

Iv. Access denied for user: ' [e-mail protected] ' to database ' Newbbs '?


Translation: User red does not have permission to manipulate database Newbbs on the localhost server? Analysis: This hint and the question three are different. That was blocked when the database was connected, and the error was caused when the database was being manipulated. Like in Selectupdate and so on. This is because the user does not have the appropriate power to manipulate the database. For example, Select this operation in Mysql.user.Select_priv record Y can operate n cannot operate. FIX: If it is your own standalone host then update Mysql.user's corresponding user record, for example, the user here to update is red. or modify it directly./config.inc.php Configure a user with permissions to database operations? or update the authorization Grantall privileges on dbname.* to ' user ' @ ' localhost ' with the following command Identified by ' password '? Tip: Update the records in the MySQL library be sure to restart the MySQL server for the update to take effect? FLUSH privileges;

Five, No Database Selected


Translation: No database is selected on? Analysis: There are two reasons for this? config.inc.php inside the $dbname set the wrong. The database does not exist at all, so in $db->select_db ($dbname); Returns False when it is the same as the above problem four, the database user does not have SELECT permission, also can cause such an error. When you find that config.inc.php's settings have no problem, but still prompt this error, that must be the case.? solve: The right remedy? Open config.inc.php Find $dbname verify reconfigure and save? Solution to Problem four

six, Can ' t Open file: ' Xxx_forums. MYI '. (errno:145)


Translation: Cannot open xxx_forums. MYI? Problem Analysis: This situation is not open cdb_forums. MYI caused by this situation may be caused by:? 1, the server is not normal shutdown, the database is full of space, or some other unknown reason, the database table caused damage.? 2, Unix-like operating system directly to the database file copy movement will be due to the file's group problems caused by this error. WORKAROUND: 1. Repair the data table? You can repair the data table in two ways: (the first method is only suitable for standalone host users)? 1) using Myisamchk, MySQL comes with a dedicated user data sheet inspection and Repair tool--MYISAMCHK. Change the current directory to Mysql/bin below, under normal circumstances only under this can run the MYISAMCHK command. Common repair commands are: Myisamchk-r data file directory/data table name. myi;?2) through PhpMyAdmin repair, phpMyAdmin with the function of repairing the data table, after entering into a table, click "Action", in the below "Table maintenance" click on "Repair table". Note: The above two methods of repair must be backed up before executing the database. 2. Modify a group of files (for standalone host users only)? 1) The database files are not set to the MySQL running account to read and write (typically for Linux and FreeBSD users) while copying the database files.

Seven, Table ' test.xxx_sessions ' doesn ' t exist


Translation: xxxxx table does not exist? Parse: The table was not found when executing the SQL statement, such as: SELECT * fromxxx_members where uid= ' XX ' here if the table Xxx_members does not exist in the $dbname library, then the error will be prompted. It can be divided into the following three kinds of situations to discuss:? When installing the plugin or hack, the program files are changed, and the database is not upgraded accordingly. The background uses incomplete backups, and importing data is not imported into the database where the appropriate version of the forum is already installed. Solve: The same remedy, Different reasons for different treatment methods. Carefully control the installation instructions provided by the plugin author, add the missing database to the operation, if it still does not solve the problem, then you should suspect the usability of the plug-in. Go to the plugin author or uninstall it. Do not pigtailed, how big feet on how big shoes to wear. In short, the program files and database matching can be.

viii. Unknown column ' column_name ' in ' Field List '

?

Translation: Unknown field name column_name? parsing: This error occurs when the Execute SQL statement is a field name that does not appear in the specified table. The causes can be divided into the following two kinds of reasons: the installation of plug-ins or hack modified the program files, and forgot to upgrade the database. program files and databases do not match, such as the d2.5 database configuration to d4.1 program to use this error will definitely occur. Resolve: Causes and issues eight of 1 and 3 is the same, so the solution is the same.

Nine, you have a error in Yoursql syntax

?

Translation: There is a syntax error in your SQL? Analysis: Forum Standard program is no SQL syntax error. So the cause of this error is generally two categories? Install the plugin or modify the program without authorization. Different database version database export Import, For example, the MySQL4.1 data in the exported statement contains MySQL4.0 features, such as Character set settings, if you import these SQL into the MySQL4.0 when the SQL syntax error occurs.????? Not really. Use standard procedures to replace the wrong program.? In the database backup should pay attention to, if you do not plan to pour into other versions of MySQL is not special considerations, and vice versa to special settings. Using DZ4.1 background Data backup, you can follow the prompts to set the desired format. Standalone hosts can also be exported to mysql4.0 format when they are everywhere. Mysqldump-uroot-p--default-character-set=latin1--SET-CHARSET=GBK--skip-opt Databse >test.sql

10, Duplicate entry ' xxx ' for key 1

?

Translation: inserting XXX causes index 1 to repeat? Analysis: If the index is a primaryunique of the 22, then the data table data corresponding to this field must guarantee the uniqueness of each record. Otherwise, this error will occur.? generally occurs when writing to the database, such as the discuz!4.1 Forum program requires all members of the user name username must be unique, that is, username index is unique, if forced to cdb_ The record of inserting an existing username in the members table will send this error, or update the username of a record to an existing username. This error can also be caused by altering the table structure. For example, in the discuz!4.0 forum database cdb_ The index type of members.username is that index is allowed to exist with the same username record at the time of upgrade to 4.1 because the index of the username is changed from the original index to unique. If there is a record of the same username in Cdb_members, then this error will be raised. When exporting data, there are times when the same record is repeatedly exported for some reason (the author is unclear). Then this backup data in the import of this error is unavoidable. Change the value of auto_increment, causing "next AutoIndex" to be an existing record? Solve: Two ideas, one is to destroy the uniqueness of the index. The second is to kill the duplicate data records and keep only one. Obviously the first way of thinking is undesirable. Then according to the two ideas we have the following solutions, corresponding to the above I IIIII? Follow the information in the error message to delete the duplicate records in the database, leaving only one. Then proceed with the upgrade operation.? The probability of this happening is small, and you can open the backup document with a text editor and look for duplicate information. Take it out of the way, just keep one. Auto_increment the largest record in the table, set the Auto_incerment higher than the first one. Ps:repaire table name to temporarily resolve the issue.

11. Duplicate Key Name ' xxx '


Translation: Duplicate index name? Analysis: The index to be created already exists, this error is raised, and this error occurs more often in the upgrade. may have been upgraded, the error caused by the repeated upgrade. It is also possible that the previous user added the index, just like in the upgrade file so the same. FIX: Look at the existing index and whether the index to be added is the same, you can skip the SQL statement, if it is not the same then delete already exist, and then execute.

12. Duplicate column name ' xxx '


Translation: Field name XXX Repeat? analysis: Added field XXX already exists, more occurs during the upgrade process, and the production of issue 12 is the same.??????????????? Remove this field if it is not the same. Then proceed with the upgrade process.

13, Table ' xxx ' alreadyexists


? translation: Data table xxx already exists? analysis: the XXX table already exists in the library, and again attempts to create the name of the table will cause this error. The same goes for the upgrade of the forum. Similar to question 12. FIX: See if the table that already exists is exactly the same as the table you are about to create, and you can skip not executing the SQL, or delete the existing table before continuing with the upgrade file.

14, Can ' t create database ' xxx '. Database exists

?

Translation: Cannot create database XXX, the database already exists? Analysis: A MySQL database name must be unique, otherwise there will be this error. FIX: Renaming an existing database or renaming the database that will be created, and not letting their names conflict.

15, summary (for problem 11\12\13\14\15)

?

There is a keyword duplicate (repeat) in the error message of this type of problem. What is not duplicated for MySQL database????????????????????????? Index key under the same data table if the same data table is indexed uniquely (uniqueprimary), these fields in the record cannot be duplicated

16. Unknown system variable ' NAMES '


Translation: Unknown system variable NAMES? Analysis: The MySQL version does not support character set setting, this error occurs when the character set is forced. Workaround: Remove the set NAMES ' xxx ' statement in the SQL statement

17. Lost Connection Tomysql server during query

?

Translation: MySQL server loses connection during query? Analysis: Remote connection to the database is sometimes problematic. The MySQL server lost connection when executing an SQL statement. Solve: Generally do not need how to deal with, if frequent occurrence so consider improving the hardware environment.

18, User ' Red ' have exceededthe ' max_updates ' resource (current value:500)

?

Translation: mSQL user red has exceeded the ' max_updates ' (maximum number of updates), ' max_questions ' (maximum number of queries), ' max_connections ' (maximum number of connections), currently set to 500? Analysis: There is a library under MySQL database for MySQL, which has a table for user the record in each of these corresponds to a MySQL user's authorization. Where the field max_questions max_updates max_connections record the maximum number of maximum number of queries Max connections, the error is generated when any one of the current parameters is greater than any one of the set values. Resolve: Standalone host users can modify authorization tables directly. After modifying, restart MySQL or follow the new authorization form into the MySQL prompt? FLUSH privileges;? Remember to have a semicolon in the back '; '? If the user of the virtual host always appears this problem can find the space quotient to resolve.

19, Too many connections (1040) chain took many ?


Translate: Reach maximum number of connections? Problem Analysis: The number of connections exceeds the value of MySQL settings and is related to Max_connections and wait_timeout. The larger the value of the wait_timeout, the longer the idle wait for the connection, which causes the current number of connections to be greater? WORKAROUND: 1. Virtual Host users please contact the space provider to optimize the configuration of MySQL server; 2. Standalone host users please contact the server administrator to optimize the configuration of the MySQL server. For reference: Modify the parameters in the MySQL configuration file My.ini or my.cnf:? max_connections= 1000?wait_timeout = 10? After modification, restart MySQL, if you regularly report this error, please do the overall optimization of the server.

20, there is no such grantdefined for the user '%s ' on host '%s '?


Error number: 1141? Problem analysis:? MySQL Current user does not have access to the database. Workaround:? 1, the virtual host users please contact the space provider, confirm to provide you with the account is authorized database permissions.? 2, independent host users please contact the server administrator to confirm that the database account you provided has permission to manage this database.

21. Error on rename of '%s ' to '%s ' (errno:%d)? error.:1025?


Problem analysis:? Check to see if your program has a statement that modifies the database table name. WORKAROUND:? 1. Please check where in your program you need to modify the database table name; 2. If your actual application does need to be modified to a database table name, Please contact the space provider or server administrator to open the permissions to modify the library name and whether the server itself is healthy.

22. Error reading file '%s ' (errno:%d)? error.:1023?


Problem Analysis: Database files cannot be read. WORKAROUND: 1. Virtual Host user Contact the space provider to see if the database is intact. 2. Standalone host user please contact the server administrator to check if MySQL itself is normal, MySQL can read files, Linux The user can check if the owner of the MySQL database file is correct and the file itself is corrupted.

23, Host ' * * * * * * * * is blockedbecause of many connection errors; unblock with ' mysqladmin flush-hosts '? error.:1 129

?

Problem Analysis: The database has an exception, please restart the database. Workaround:? 1. Due to a lot of connection errors, host ' * * * * is blocked, virtual host users contact the space quotient processing, independent host users please contact the server administrator, under the command console of MySQL execute ' mysqladmin flush-hosts ' unblock, or restart MySQL Database

24. Dropping database (can ' tdelete '%s ', errno:%d)? error.:1009?


Problem Analysis: Cannot delete database file, cause delete database failed. Workaround:? 1. Check that the database management account you are using has permission to delete data. 2. Check to see if the database exists.

25. Got error from Tablehandler? error.:1030?


Problem Analysis: The disk space of the database is full. WORKAROUND:? 1. Virtual Host users contact the space quotient to increase the disk space where MySQL is located or to clean up some useless files; 2. Standalone host users please contact the server administrator to increase the disk space where MySQL resides or to clean up some useless files

26, Can ' t create a newthread; If you is not out of available memory, you can consult the manual fora possible os- Dependent bug. ? error.:11/35?


Problem Analysis: Database server problem, database operation cannot create new thread. There are generally two reasons:? 1. Server system memory overflow. 2. Environmental software corruption or system corruption. WORKAROUND: 1. Virtual Host user please contact the space quotient database server for the memory and system is normal.? 2. Standalone host user please contact the server administrator to check the server's memory and system is correct. If server memory is tight, check which processes consume the server's memory, and consider whether to increase the server's memory to increase the overall load capacity.

27, Error:client does Notsupport authentication protocol requested by server; consider upgrading MYSQLCLIENT?error.:1251?


problem analysis:? If you experience the above issues after upgrading MySQL to 4.1 or above, please make sure that your MySQL Client is 4.1 or later (windows There is a problem you just jump down to see the workaround, because MySQL is client and server in Windows Installed together).? Workaround: 1.Windows platform? Mainly to change the encryption method of the account that is connected to MySQL, MySQL 4.1/5.0 is encrypted by password this way. can be resolved in the following two ways:? 1) Mysql->set PASSWORD for ' some_user ' @ ' some_host ' =old_password (' new_password ');? 2) mysql->update mysql.user setpassword=old_password (' New_password ') WHERE host= ' some_host ' ANDUser= ' some_user ';? 2.linux/unix platform? Linux platform to first determine whether to install the MySQL client, this is easy to install with RPM, the Linux code is:? RPM-IVH mysql-client-4.1.15-0.i386.rpm? Then, when compiling PHP, add:?-- With-mysql=/your/path/to/mysql? In general, it can be solved. If this error still occurs, you can do this in the following way:? Mysql->set PASSWORD for ' some_user ' @ ' some_host ' =old_password (' new_password ');? Mysql->update mysql.user SET password=old_password (' New_password ') WHERE host= ' some_host ' and user= ' some_user ';

28. Error:can ' t connect tolocal MySQL server through socket '/var/lib/mysql/mysql.sock '? error.:2002?


Problem Analysis: This error generally occurs because of the following two reasons:? The 1.MySQL server is not turned on.? 2.MySQL server is turned on, but the socket file cannot be found. Workaround:? 1. Virtual Host user, contact the space provider to confirm that the database is starting correctly.? 2. Independent host users, please check if the MySQL service is turned on, do not open, please start the MySQL service, if it is turned on, and is a Linux system, please check the path of the MySQL socket, and then open config.inc.php find? $dbhost = ' localhost '; After hostname, add the colon ': ' and the path to the MySQL socket. For example, MySQL server is localhost? MySQL socket path is/tmp/mysql.sock? Then change to the following:? $dbhost = ' Localhost:/temp/mysql.sock ';

29. Can ' t connect to MySQLServer on ' localhost '? error.:2003?


Problem analysis:? MySQL service does not start, generally in the case of abnormal MySQL can not boot, such as no disk space available, My.ini mysql basedir path setting error, etc. workaround:? 1. Check disk space for any remaining free space. Try to keep enough disk space available. 2. Check that the Basedir parameters in the My.ini are set correctly, and then restart the MySQL service.

30, Lost connection to MySQLServer during query? error.:2013


? problem Analysis: The connection to the MySQL server was lost during the database query. WORKAROUND:? 1. Please make sure your program is inefficient program, such as some plug-ins, you can uninstall the plugin, check the server is normal; 2. The server itself is resource-intensive, Virtual Host users please contact the space provider to confirm, independent host users please contact the server administrator, check whether the server is normal.

31, Got a packet bigger than\ ' max_allowed_packet\ ' bytes?


Error number: 1153? Problem Analysis: Adjusted the size of the upload attachment of Mantis but did not adjust the MySQL configuration file. Workaround:? 1, independent host users please adjust as follows:? Find the MySQL configuration file (my.cnf or My.ini)? In the [ MYSQLD] section Add a sentence (if present, adjust its value can be):? max_allowed_packet=10m? Restart the MySQL service. This is set to 10MB.




Summary of common error analysis and solution methods for MySQL

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.