Common error analysis and solution for MySQL _mysql

Source: Internet
Author: User
Tags mysql client mysql version phpmyadmin server memory

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

Translation: Can't connect to MySQL on localhost? Analysis: This indicates that the "localhost" computer exists, but does not provide MySQL service 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. FIX: Since it's not started, go and start MySQL on this machine. If the startup is unsuccessful, most of your my.ini configuration is problematic. Reconfigure it.? If you feel the MySQL load exception, you can go to the Mysql/bin directory to perform mysqladmin-uroot-p123 processlist to view the current MySQL process.

Second, Unknown MySQL serverhost ' localhosadst ' (11001)

Translation: unknown MySQL server LOCALHOSADST? Analysis: Server LOCALHOSASDST does not exist. Or is it impossible to connect at all? Resolve: Carefully check your own forum below./config.inc.php find $dbhost reset to the correct MySQL server address.
   

Third, Access denied for user: ' Roota@localhost ' (Using password:yes)

The user Roota access localhost is denied (not allowed to pass)? analysis: Causing this error general database username and password relative to MySQL server incorrect? Resolve: Carefully check yourself under the Forum./config.inc.php Find $dbuser, $ DBPW after verification, reset save.

Four, Access denied for user: ' Red@localhost ' to database ' Newbbs '?

Translation: User red does not have permission to manipulate the database on the localhost server Newbbs? analysis: This hint and 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 the Mysql.user.Select_priv record Y can manipulate n is not allowed to operate.? Solve: If it is their own stand-alone host then update mysql.user corresponding user record, such as the user here to update is red. or directly modify./config.inc.php to configure a user with permission to manipulate the database? or update the authorization Grantall privileges on dbname.* to ' user ' @ ' localhost ' by following the command Identified by ' password '? Hint: Update the records in the MySQL library must restart the MySQL server in order for the update to take effect? FLUSH privileges;

Five, No Database Selected

No database is selected? Analysis: There are two reasons for this? config.inc.php inside $dbname set wrong. Cause the database does not exist at all, so in $db->select_db ($dbname); Returns False if it is the same as the above question four, the database user does not have SELECT permission, also can cause this kind of error. When you find that there is no problem with the config.inc.php settings, but it is still a hint of the error, it must be the case. Solve: Prescribe the right remedy? Open config.inc.php Find $dbname verify reconfigure and save? Solution for the same problem four

VI, 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, the possible causes of this situation are:? 1, the server is not normal shutdown, the database is full of space, or some other unknown reasons, the database table caused damage. 2, the Unix-like operating system directly to move the database file copies of the file because of the group problem caused by this error. Workaround: 1, repair datasheet? You can use the following two ways to repair a datasheet: (the first method is only suitable for stand-alone host users)? 1) using Myisamchk, MySQL has its own tools for checking and repairing data tables with special users--myisamchk. Changes to the current directory under Mysql/bin, under normal circumstances can only run the MYISAMCHK command. The commonly used repair commands are: Myisamchk-r data file directory/datasheet name. myi;?2) through phpMyAdmin repair, phpmyadmin with the function of repairing the data table, enter into a table, click "Operation", in "Table maintenance" in the bottom click "Repair Table" can. Note: The above two repair methods must be backed up before execution. 2, Modify the group of files (for stand-alone host users only)? 1 the database file was not set to the MySQL running account in the process of copying the database files (generally applicable to Linux and FreeBSD users).

Vii. Table ' test.xxx_sessions ' doesn ' t exist

The xxxxx table does not exist? Analysis: The table was not found when executing the SQL statement, for example: SELECT * fromxxx_members where uid= ' XX ' This error is prompted if the table Xxx_members does not exist in the $dbname library. The concrete can be divided into the following three kinds of situations to discuss:? When you install a plugin or hack, you modify the program file and forget to upgrade the database accordingly. An incomplete backup was used in the background, and the data was imported without being imported into the database where the appropriate version of the Forum was installed. Solution: The same remedy, Different reasons for different processing methods. Carefully control the installation instructions provided by the plugin author to make up for the omission of the operation of the database, if it still does not solve the problem, then the availability of the plug-in should be suspected. Go to the plugin author, or uninstall it. Don't confusedly, how big shoes you wear. In short, make the program file and database matching can.

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

Translation: Unknown field name column_name? analysis: This error occurs when the Execute SQL statement appears with a field name that is not in the specified table. The specific causes can be divided into the following two kinds? When you install a plugin or hack, you modify the program file and forget to upgrade the database accordingly. program files and databases do not match, such as the d2.5 database configuration to d4.1 program to use this error will certainly occur. Resolution: Causes and problems caused by eight of the 1 and 3 is the same, so the solution is the same.

Nine, you have a error in Yoursql syntax

Translation: Is there a grammatical error in your SQL? Analysis: Forum Standard program is no SQL syntax error. So the reason for this error is generally two categories? Install the plugin or modify the program without authorization.? different database version database export Import, For example, MySQL4.1 data in the exported statement contains MySQL4.0 functions, such as set of character sets, then if you import these SQL into the MySQL4.0 will produce SQL syntax error.? To fix: To look carefully at what's wrong and fix it, Not really. Use standard procedures to replace the wrong program.? In the database backup time to pay attention to, if you do not intend to pour into other versions of MySQL without special considerations, the contrary to special settings. Using DZ4.1 background Data backup, you can follow the prompts to set the desired format. Stand-alone hosts can also be exported to mysql4.0 formats when they are everywhere. Mysqldump-uroot-p--default-character-set=latin1--SET-CHARSET=GBK--skip-opt Databse >test.sql

X. Duplicate entry ' xxx ' for key 1

Translation: Insert xxx to make index 1 redundant? analysis: If the index is primaryunique these 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 discuz!4.1 forum procedures require that all members of the user name username must be unique, that is, username index is unique, when forcibly to Cdb_ A record of an existing username is inserted in the members table, or the username of a record is updated to an existing username.? This error can also be caused by changing the table structure. For example, the discuz!4.0 forum database cdb_ The index type of members.username is this time that index is allowed to have the same username record, and when it is upgraded to 4.1, the username index is changed from original index to unique. If there is a record of the same username in the cdb_members, then this error is raised.? exporting data is sometimes caused by several reasons (the author is not yet clear) that causes the same record to be exported repeatedly. It is inevitable that this backup data will be present in the import.? Modify the value of the auto_increment, causing the "next AutoIndex" to be an existing record? Resolve: Two ideas, one is to destroy the uniqueness of the index. The second is to kill the duplicate data records, only one. It is clear that the first idea is undesirable. Then according to the two ideas we come up with the following solutions, corresponding to the above I IIIII? Follow the information in the error message to delete duplicate records in the database, leaving only one. Then continue with the upgrade operation.? The probability of this happening is very small, you can open the backup document with a text editor to find duplicate information. Take away the extra, just keep one. Query out of the table Auto_increment largest record, set auto_incerment than its freshman can. Ps:repaire table name, you can temporarily resolve the problem.

Xi. Duplicate key Name ' xxx '

Duplicate index name? Analysis: The index to be created already exists and this error is raised, which occurs more often during an upgrade. may have been upgraded, repeat the error caused by the upgrade. It is also possible that the user had previously added the index, just the same as in the upgrade file. Workaround: See if the existing index is the same as the index to be added, the same words can skip this SQL statement, if not the same so now delete existing so, then execute.

12, Duplicate column name ' xxx '

? translation: Field name XXX Repeat? analysis: Added field XXX already exists, most of which occurs during the upgrade process and is the same as problem 12. WORKAROUND: See if the field that already exists is exactly the same as the field property that will be added, and if the same can be skipped without executing this SQL, If it's not the same, delete the field. Then continue with the upgrade program.

13, Table ' xxx ' alreadyexists

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

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

Translation: Cannot create database XXX, database already exists? Analysis: A MySQL the database name below must be guaranteed to be unique, otherwise there will be this error.?????????

Summary (for problem 11\12\13\14\15)

This type of problem is hidden in a keyword duplicate (repeat)? So what's not a duplicate of the MySQL database? data table table under same database table? field column under the same datasheet? Index key under the same data table the fields in the record cannot be duplicated with the same datasheet in the case of an index unique (uniqueprimary)

16, Unknown system variable ' NAMES '

The unknown system variable NAMES? Analysis: The MySQL version does not support character set setting, this error will occur when the character set is forced.? Resolve: Remove the set NAMES ' xxx ' statement from the SQL statement

17. Lost Connection Tomysql server during query?

Translation: MySQL server lost connection during query? Analysis: Remote connection database is sometimes the problem. The MySQL server lost its connection when executing an SQL statement.???????????????????????????????

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

Translation: mSQL user red has exceeded ' max_updates ' (maximum number of updates), ' max_questions ' (maximum number of queries), ' max_connections ' (maximum number of connections), currently set to 500? Analysis: In the MySQL database under a library for MySQL, which has a table for user this inside the record each of the corresponding to a MySQL user authorization. Where the field max_questions max_updates max_connections Records maximum number of maximum queries, respectively, when any one of the current parameters is greater than any one set value will produce this error.? To resolve: Independent host users can directly modify the authorization table. Restart MySQL after the modification, or follow the new authorization form and go to the MySQL prompt? FLUSH privileges;? Remember to have a semicolon '; '? If the user of the virtual host always appears this problem can find a space business to negotiate solution.

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

Translation: Maximum number of connections? Problem Analysis:? The number of connections exceeds the value of the MySQL setting and is related to both max_connections and wait_timeout. The larger the value of the wait_timeout, the longer the idle wait for the connection, which will cause the current number of connections to be larger. WORKAROUND: 1. Virtual Host users please contact the space provider to optimize the MySQL server configuration; 2. Independent Host users please contact the server administrator to optimize the MySQL server configuration. Can refer to:? Modify the parameters in the MySQL configuration file My.ini or my.cnf:? max_connections= 1000?wait_timeout = 10? Restart MySQL after modification, if you regularly report this error, please do the overall optimization of the server.

20, There is no such grantdefined to user '%s ' on host '%s '?

Error number: 1141? Problem analysis:? MySQL The 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 number of authorized database permissions. 2, independent host users please contact the server administrator, to confirm to you provide the database account number has the right to administer this database.

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

Problem analysis:? Please check if your program has a statement that modifies the database table name. How to:? 1. Please check which parts of your program need to modify the database table name; 2. If your actual application does need to be modified to the database table name, Contact your space provider or server administrator to open the permissions for modifying the library name and the server itself.

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

Problem analysis:? The database file cannot be read. How to:? 1. Virtual Host users please contact the space provider to see if the database is intact. 2. Independent host users please contact the server administrator to check whether MySQL itself is normal, MySQL can read files, Linux Users can check if the owner of MySQL's database files is correct and if their files are corrupted.

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

Problem analysis:? The database has an exception, please restart the database.? Workaround:? 1. Due to a lot of connection errors, the host ' * * * is blocked, the virtual host users please contact the space business, independent host users please contact the server administrator, in the MySQL command console under the "Mysqladmin flush-hosts" to remove the shield can, or restart MySQL Database

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

Problem analysis:? The database file cannot be deleted, resulting in the deletion of the database. How to:? 1. Check to see if the database management account you are using has permission to delete data. 2. Check that the database exists.

25, Got error from tablehandler?error.:1030?

Problem analysis:? The database is full of disk space. How to:? 1. Virtual Host users please contact the space provider to increase the disk space of MySQL or clean up some useless files; 2. Independent host users contact the server administrator to increase the disk space where MySQL resides or to clean up some unwanted files

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

Problem analysis:? database server problem, database operation cannot create new thread. 一般是两个原因:?1.服务器系统内存溢出。?2.环境软件损坏或系统损坏。?解决方法:?1.虚拟主机用户请联系下空间商数据库服务器的内存和系统是否正常。?2.独立主机用户请联系服务器管理员检查服务器的内存和系统是否正常, 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 by server; Consider upgrading mysqlclient?error.:1251?

    problem Analysis:? If you are upgrading MySQL to more than 4.1 version of the above problems, please make sure that your MySQL Client is 4.1 or later (if there is a problem with windows, you jump directly to the following to see the solution, because MySQL is installed with Windows client and server. How to: 1.Windows platform? The main is to change the encryption of the account connected to MySQL, MySQL 4.1/5.0 is encrypted by password this way. This can be resolved in 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 first to determine whether the client installed MySQL, this RPM installation is very simple, the Linux code is:? RPM-IVH mysql-client-4.1.15-0.i386.rpm? And then when compiling PHP, add the following:?-- With-mysql=/your/path/to/mysql? can be solved under normal circumstances. If this error occurs, you can do so in the following ways:? 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 '?

Problem Analysis:? This error is generally due to the following two reasons:? The 1.MySQL server is not turned on.? The 2.MySQL server is turned on, but the socket file cannot be found. How to resolve:? 1. Virtual host user, please contact Space Trader to confirm that the database is starting normally.? 2. Independent host user, please check the MySQL service is turned on, not open, please start the MySQL service; if it is turned on and Linux, please check the path of the MySQL socket and open config.inc.php to find it? $dbhost = ' localhost '; Add a colon ': ' and the path to the MySQL socket after the hostname.? like MySQL server for localhost? The path of the MySQL socket is/tmp/mysql.sock? Then change it 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 the exception of MySQL can not boot, such as no available disk space, My.ini mysql basedir path settings error, and so on.? How to:? 1. Check the disk space for remaining free space, Try to keep enough disk space available. 2. Check the My.ini in the Basedir parameter settings are correct, and then restart the MySQL service.

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

?问题分析:?数据库查询过程中丢失了与MySQL 服务器的连接。?解决方法:?1.请确认您的程序中是否有效率很低的程序,比如某些插件,可以卸载掉插件,检查一下服务器是否正常;?2.服务器本身资源紧张, Virtual Host users please contact the space provider to confirm that the independent host user please contact the server administrator, check the server is normal.

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

Error number: 1153? Problem Analysis: Adjusted the Mantis upload attachment size but did not adjust the MySQL configuration file.? 1, independent host users to adjust the following methods:? Find MySQL Profile (my.cnf or My.ini)? MYSQLD] section (if present, adjust its value can be):? Restart the MySQL service on the max_allowed_packet=10m. This is set to 10MB.

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.