MySQL errors and Solutions

Source: Internet
Author: User
Tags pconnect mysql command line

Original address: http://www.phpwind.net/simple/index.php? T255122.html & t = 1

MySQL errors and solutions (continuously improving)

Note: If a database error occurs, modify the corresponding code and restart MySQL. If you encounter a MySQL problem, restart MySQL to see if the problem can be solved.
1005: An error occurred while creating the table.
1006: database creation failed
1007: the database already exists. An error occurred while creating the database.
1008: the database does not exist. An error occurred while deleting the database.
1009: the database file cannot be deleted, leading to database deletion failure.
1010: failed to delete database because the data directory cannot be deleted
1011: An error occurred while deleting the database file.
1012: records in the system table cannot be read.
1016: Unable to open the file
Start after clicking => All Programs => attachments => Command Prompt
Enter the hard drive letter of the MySQL instance.
Directory of CD MySQL
CD Bin
Enter myisamchk-f d: usr/local/MySQL/data/BBS/pw_members.myi
PS: D: usr/local/MySQL/data/BBS is the path of your forum Database
-F is selected based on the actual situation. Generally, you can select-R.
Pay attention to whether your system disk C or the hard disk space for storing the database is sufficient. Generally, errors may occur if the disk space is less than 1 GB.

Or use the mysqlcheck command to fix the issue. Specific Method: Use the command line to enter the MySQL/bin directory and execute

Mysqlcheck-o-r phpwind-uroot-P

Phpwind indicates the name of your database, and root indicates your database username. Then, you are prompted to enter the password.

Then your database will be repaired.
1020: the record has been modified by another user
1021: The remaining space on the hard disk is insufficient. please increase the available space on the hard disk.
1022: duplicate keywords. failed to change the record
1023: An error occurred while disabling the service.
1024: An error occurred while reading the file.
1025: An error occurred while changing the name
1026: file write error
1032: the record does not exist
1036: The data table is read-only and cannot be modified.
1037: The system memory is insufficient. Restart the database or restart the server.
1038: the memory used for sorting is insufficient. Increase the sorting buffer.
1040: Maximum number of connections to the database. Increase the number of available connections to the database.
1041: insufficient system memory
1042: Invalid Host Name
1043: Invalid connection
1044: the current user is not authorized to access the database
1045: the database cannot be connected. The user name or password is incorrect.
Method: Make sure that the SQL _config.php user name and password under the Forum data directory are correct. If you forget the database password, you can modify the password as follows:
If MySQL is running, stop it first.
Start MYSQL: Bin/safe_mysqld -- skip-grant-tables &
You can access MySQL without a password.
Then
> Use MySQL
> Update user SET Password = PASSWORD ("new_pass") where user = "root ";
> Flush privileges;

Make sure that the data directory has the write permission when the database username and password are correct. For Windows hosts, you can set the users user group to have the write permission in the data directory. You can use chmod-r 777 data to modify Linux-like systems.

1040: Maximum number of connections
Method: In my. ini, modify max_connections = 100 to max_connections = 1000 or greater, and restart MySQL.
1048: The field cannot be blank
1049: the database does not exist.
1050: The data table already exists.
1051: The data table does not exist.
1054: The field does not exist.
1065: Invalid SQL statement. The SQL statement is empty.
1081: cannot establish socket connection
1114: The data table is full and cannot accommodate any records
1116: too many open data tables
1129: Database exception. Restart the database.
1130: failed to connect to the database. You are not authorized to connect to the database.
1133: the database user does not exist
1141: the current user is not authorized to access the database
1142: the current user is not authorized to access the data table
1143: the current user is not authorized to access fields in the data table.
1146: The data table does not exist.
1147: the user's access permission to the data table is not defined.
1149: SQL statement syntax error
1158: network error. Read error. Check the network connection status.
1159: network error. Read timeout. Check the network connection status.
1160: network error. A write error occurs. Check the network connection status.
1161: network error. Write timeout. Check the network connection status.
1062: The field value is repeated and the Database Import fails.
Method:
1. if an error similar to the primary code "65535" is returned, you can view the auto-increment field of the relevant table and change the field value
2. Make sure that the fields with repeated primary codes exist in the relevant data table. If yes, delete this record.
3. Back up the database and repair related tables (note: this situation is common, such as the pw_posts table. Do not forget to back up the tables when repairing them ).
1169: The field value is repeated and the update record fails.
1177: An error occurred while opening the data table.
1180: Transaction submission failed
1181: Transaction rollback failed
1203: the maximum number of connections established between the current user and the database to reach the database. Increase the number of available database connections or restart the database.
1205: lock timeout
1211: the current user does not have the permission to create a user
1216: failed to check foreign key constraints and failed to update sub-table records
1217: failed to check foreign key constraints, failed to delete or modify the primary Table Record
1226: The resource used by the current user has exceeded the allowed resource. Please restart the database or the server.
1227: You are not authorized to perform this operation.
1235: mysql version is too low and does not have this function

1250: the client does not support the authentication protocol required by the server. Please consider upgrading the client.

1251: client does not support Authentication Protocol requested by server; consider upgrading MYSQL client

Method 1: mysql> set password
-> 'Some_user' @ 'some_host '= old_password ('newpwd ');

Run the following command in MySQL command line client based on our actual situation:

Set password for root @ localhost = old_password ('20140901 ');

Method 2:

Mysql> Update mysql. User SET Password = old_password ('newpwd ')
-> Where host = 'some _ host' and user = 'some _ user ';
Mysql> flush privileges;

Modify the red part according to your actual situation.

10061: Method: Start the MySQL service on this machine.
If the service fails to be started
It must have been an error in your my. ini file,
MySQL service cannot be started normally
After you delete it, MySQL runs according to its default configuration,
Then there is no problem.
10048:
We recommend that you modify the maximum number of connections in the my. ini file,
Change the mysql_connect () method to the mysql_pconnect () method.
To modify mysql_pconnect (), you can go to SQL _config.php in the data directory of the Forum.
$ Pconnect = 0; // whether the connection is persistent
Change to $ pconnect = 1;
Enable anti-Refresh. Do not refresh too quickly.
10055: no cache space available
Method: Check whether your drive C is full and clear useless files.
You can enable "Process Optimization" in "Forum core Settings", "core function Settings", and "gzip compressed output" in the background.

I found the cause of the error 10055 (no cache space available) and analyzed the configuration file of my. ini, as shown in my. ini:
Default-storage-engine = InnoDB
Innodb_additional_mem_pool_size = 2 m
Innodb_flush_log_at_trx_commit = 1
Innodb_log_buffer_size = 1 m
Innodb_buffer_pool_size = 10 m
Innodb_log_file_size = 10 m
Innodb_thread_concurrency = 8

I think we can increase innodb_buffer_pool_size = 10 m, for example, 1000 m or M.

The above is for mysql5

For mysql4, you can add the following in my. ini:

# Innodb_data_file_path = ibdata1: 2000 m; ibdata2: 2000 m
# Innodb_data_home_dir = C: ibdata
# Innodb_log_group_home_dir = C: iblogs
# Innodb_log_arch_dir = C: iblogs
# Set-variable = innodb_mirrored_log_groups = 1
# Set-variable = innodb_log_files_in_group = 3
# Set-variable = innodb_log_file_size = 5 m
# Set-variable = innodb_log_buffer_size = 8 m
# Innodb_flush_log_at_trx_commit = 1
# Innodb_log_archive = 0
# Set-variable = innodb_buffer_pool_size = 16 m
# Set-variable = innodb_additional_mem_pool_size = 2 m
# Set-variable = innodb_file_io_threads = 4
# Set-variable = innodb_lock_wait_timeout = 50

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.