MySQL common error analysis and solution Summary

Source: Internet
Author: User
1. Canrsquo; tconnecttoMySQLserveronlsquo; localhostrsquo; (10061) Translation: cannot connect to mysql Analysis on localhost: This description

1. Canrsquo; t connect to MySQL server on lsquo; localhostrsquo; (10061) Translation: cannot connect to mysql Analysis on localhost: This description

1. Can't connect to MySQL server on 'localhost' (10061)
Translation: cannot connect to mysql on localhost
Analysis: This indicates that the "localhost" computer exists, but the MySQL service is not provided on this machine.
You need to start the MySQL service on this machine. If the sub-server load is too high and the request is not available, this error will also be generated.
Solution: Since mysql is not started, start mysql on this machine. If the startup fails, most of them are caused by problems with your my. ini configuration. You can reconfigure it.
If the mysql server load is abnormal, run mysqladmin-uroot-p123 processlist In the mysql/bin directory to view the current mysql process.

2. Unknown MySQL Server Host 'localhosadst' (11001)
Translation: Unknown MySQL Server localhosadst
Analysis: the server localhosasdst does not exist. Or cannot be connected at all.
Solution: carefully check the./config. inc. php under your forum and find $ dbhost and reset it to the correct mysql server address.

3. Access denied for user: 'roota @ localhost' (Using password: YES)
Translation: The user's roota access to localhost is denied (not allowed to pass)
Analysis: this error is caused. Generally, the database username and password are incorrect compared to the mysql server.
Solution: carefully check the./config. inc. php under your forum and find $ dbuser and $ dbpw. Then reset and save the settings.

4. Access denied for user: 'Red @ localhost' to database 'newbbs'
User red does not have the permission to operate the database newbbs on the localhost Server
Analysis: This prompt is different from question 3. This error is caused by database operations. For example, in select update. This is because the user has no right to operate the database. For example, the select Operation Records Y in mysql. user. Select_priv and can operate N.
Solution: if it is your own independent host, update the corresponding user records of mysql. user. For example, the user to be updated here is red. You can also directly modify./config. inc. php to configure a user with database operation permissions.
Alternatively, run the following command to update the authorization grant all privileges on dbname. * to 'user' @ 'localhost' identified by 'Password'
Tip: to update the records in the mysql database, you must restart the mysql server to make the update take effect.
Flush privileges;

5. No Database Selected
Translation: no database is selected
Analysis: There are two causes
$ Dbname in config. inc. php is set incorrectly. As a result, the database does not exist at all. Therefore, false is returned when $ db-> select_db ($ dbname );
This is the same as issue 4 above. database users do not have the select permission and will also cause such errors. When you find that the configuration of config. inc. php is correct, but the error is still prompted, it must be the case.
Solution: Remedies
Open config. inc. php and find $ dbname to verify the configuration and save it.
Solution to problem 4

6. Can't open file: 'xxx _ forums. myi'. (errno: 145)
Translation: cannot open xxx_forums.MYI
Problem Analysis:
In this case, you cannot open cdb_forums.MYI. The possible causes include:
1. The server shuts down abnormally, the database space is full, or some other unknown reasons cause damage to the database table.
2. This error occurs when database files are directly copied and moved in unix-like operating systems due to file group issues.
Solution:
1. Repair Data Tables
You can use the following two methods to repair data tables: (the first method is only applicable to independent host Users)
1) Using myisamchk, MySQL comes with a dedicated user data table check and Repair Tool-myisamchk. Change the current directory to MySQL/bin. Generally, the myisamchk command can be run only under this directory. Common repair commands: myisamchk-r data file directory/data table name. MYI;
2) use phpMyAdmin to fix the data table. phpMyAdmin provides the data table repair function. after entering a table, click "operation" and click "repair table" in "Table maintenance" below.
Note: You must back up the database before performing the preceding two restoration methods.
2. Modify the file group (only applicable to independent host Users)
1) When copying a database file, the database file is not set to an account running MySQL that can be read and written (generally applicable to Linux and FreeBSD users ).

7. Table 'test. xxx_sessions 'doesn' t exist
Translation: The xxxxx table does not exist.
Analysis: The table is not found when the SQL statement is executed. For example, SELECT * FROM xxx_members WHERE uid = 'xx'. If the xxx_members table does not exist in the $ dbname database, this error is prompted. There are three situations to discuss:
When installing the plug-in or hack, I modified the program file and forgot to upgrade the database accordingly.
Incomplete backups are used in the background, and the imported data is not imported into the database of the Forum with the corresponding version installed.
Solution: the solution is the same as the remedy, and the solution is different for different reasons.
Carefully compare the installation instructions provided by the plug-in author to add the missing operations on the database. If the problem still cannot be solved, you should doubt the availability of the plug-in. Consult the plug-in author or uninstall the plug-in.
Do not wear big shoes. In short, make the program file and database support.

8. Unknown column 'column _ name' in 'field list'
Translation: Unknown field name column_name
Analysis: this error occurs when the field name is not in the specified table when the SQL statement is executed. The specific causes can be divided into the following two types:
When installing the plug-in or hack, I modified the program file and forgot to upgrade the database accordingly.
The program file is not compatible with the database. For example, this error is certainly returned when the d2.5 database is configured for the d4.1 program.
Solution: The cause is the same as that of problem 8. Therefore, the solution is the same.

9. You have an error in your SQL syntax
Translation: There is a syntax error in your SQL
Analysis: There is no SQL syntax error in the standard program of the Forum. There are two possible causes for this error:
Install plug-ins or modify programs without authorization.
Database Export and Import in different database versions. For example, the data in MySQL4.1 contains functions not available in MySQL4.0 in the Export Statement, such as Character Set setting, if these SQL statements are imported to MySQL4.0, an SQL syntax error occurs.
Solution:
Check carefully to see where the error occurred and correct it. If it is not feasible, replace the program with the standard program.
Pay attention when backing up the database. If you do not plan to import data to other versions of mysql, you do not need to consider it. Otherwise, you need to set it specially. You can follow the prompts to set the desired format by using DZ4.1 background data backup. The independent host can also export it everywhere in the format of mysql4.0.
Mysqldump-uroot-p-default-character-set = latin1-set-charset = gbk-skip-opt databse> test. SQL

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.