yabsoft
10-11-2006, 01:43 PM
Database Error Corrections
Introduction
1016 - Can't open file Solution
1030 - Got error 127 from table handler Solution
1030 - Got error 28 from storage engine Solution
1046 - No Database Selected Solution
Warning: mysql_connect(): Access denied for user:Solution
Warning: mysql_connect(): Can't connect to local MySQL server through socket Solution
Warning: mysql_connect(): Host '******' is not allowed Solution
Warning: Too many connections
Warning: Too many connections Solution
References
Introduction
Some common errors and faq's are listed below describing a certain database error that might be encountered and a solution to that error.
1016 - Can't open file
The following error message is shown when a database table is corrupt and can no longer be accessed nor read properly:
1016 - Can't open file '<database table name>.MYI' (errno: 145)
The error message will always be shown until the database table involved has been repaired.
Solution
The following methods are available to repair damaged database tables, depending on whether the database server is still running or not:
Using the "repair table" SQL statement
Using the "myisamchk" commandThe <database table name> part in the commands below must be replaced with the actual database table name as shown in the error message.
Using the "repair table" SQL statement
The following SQL statement can be executed when the database server is still running:
repair table <database table name>;
Using the "myisamchk" command
The following command, which is part of the MySQL installation, can be executed on the server when the database server is no longer running:
myisamchk /path/to/database/directory/<database table name>.MYI
References
MySQL Documentation: 15.1.4.1 Corrupted MyISAM Tables (http://dev.mysql.com/doc/mysql/en/Corrupted_MyISAM_tables.html)
MySQL Documentation: 14.5.2.6 REPAIR TABLE Syntax (http://dev.mysql.com/doc/mysql/en/REPAIR_TABLE.html)
MySQL Documentation: 5.6.2.1 myisamchk Invocation Syntax (http://dev.mysql.com/doc/mysql/en/myisamchk_syntax.html)
1030 - Got error 127 from table handler
This indicates the table mentioned is corrupt.
Solution
Try running a repair and optimize on the table in phpMyAdmin.1030 - Got error 28 from storage engine
Error code 28: No space left on device.This indicates the table mentioned is corrupt.
Solution
Try running a repair and optimize on the table in phpMyAdmin.1046 - No Database Selected
This indicates that either no database has been created or the wrong database name $sql_database exists in the config.php files.
Solution
Check to make sure the database has been created and the config.php file for correct database name.Warning: mysql_connect(): Access denied for user:
The following error message is shown when either the username or password is incorrect for the database connection:
FATAL ERROR: Connection to database server failed.
Warning: mysql_connect(): Access denied for user: 'username@localhost' (Using password: YES)
Solution
You will need to check with your hosting provider the username and password required to access the MySQL database and/or check the config.php file for incorrect information.Warning: mysql_connect(): Can't connect to local MySQL server through socket
The error Can't connect to ... normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket filename or TCP/IP port number when trying to connect to the server.
FATAL ERROR: Connection to database server failed.
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
Solution
The following are checks for mysql to see if it is running and setup properly.
1. Start by checking whether there is a process named mysqld running on your server host.
Use ps xa | grep mysqld on Unix or the Task Manager on Windows.
2. It might also be that the server is running, but you are trying to connect using a TCP/IP port, named pipe, or Unix socket file different from those on which the server is listening. To find out what port is used, and where the socket is, you can do:
shell> netstat -l | grep mysql
3. The grant tables must be properly set up so that the server can use them for access control.
One way to determine whether you need to initialize the grant tables is to look for a `mysql' directory under the data directory. (The data directory normally is named `data' or `var' and is located under your MySQL installation directory.) Make sure that you have a file named `user.MYD' in the `mysql' database directory. If you do not, execute the mysql_install_db script. After running this script and starting the server, test the initial privileges by executing this command:
shell> mysql -u root test
4. Sometimes a simple restart of mysql will fix the problem.
References
MySQL Documentation: 5.5.8 Causes of Access denied Errors (http://dev.mysql.com/doc/mysql/en/Access_denied.html)
MySQL Documentation: A.2.2 Can't connect to [local] MySQL server (http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html)
Warning: mysql_connect(): Host '******' is not allowed
This indicates the wrong server $sql_host information in the config.php file.
FATAL ERROR: Connection to database server failed.
Warning: mysql_connect(): Host '******' is not allowed to connect to this MySQL server
Solution
Check the config.php file for incorrect information. If the error shows on secondery server, you need add secondery host '******' to the lists of access hosts of main server!Warning: Too many connections
The following error message is shown when the maximum number of connections to the database server has been reached:
FATAL ERROR: Connection to database server failed.
Warning: Too many connections in /path/to/includes/database.php on line 19 Warning: MySQL Connection Failed: Too many connections
Solution
This problem is common for shared hosting servers and requires correspondance with the server administrator.
This problem is generally not a fault of MFHS, but can be experienced when MFHS is installed on budget hosting servers.
Introduction
1016 - Can't open file Solution
1030 - Got error 127 from table handler Solution
1030 - Got error 28 from storage engine Solution
1046 - No Database Selected Solution
Warning: mysql_connect(): Access denied for user:Solution
Warning: mysql_connect(): Can't connect to local MySQL server through socket Solution
Warning: mysql_connect(): Host '******' is not allowed Solution
Warning: Too many connections
Warning: Too many connections Solution
References
Introduction
Some common errors and faq's are listed below describing a certain database error that might be encountered and a solution to that error.
1016 - Can't open file
The following error message is shown when a database table is corrupt and can no longer be accessed nor read properly:
1016 - Can't open file '<database table name>.MYI' (errno: 145)
The error message will always be shown until the database table involved has been repaired.
Solution
The following methods are available to repair damaged database tables, depending on whether the database server is still running or not:
Using the "repair table" SQL statement
Using the "myisamchk" commandThe <database table name> part in the commands below must be replaced with the actual database table name as shown in the error message.
Using the "repair table" SQL statement
The following SQL statement can be executed when the database server is still running:
repair table <database table name>;
Using the "myisamchk" command
The following command, which is part of the MySQL installation, can be executed on the server when the database server is no longer running:
myisamchk /path/to/database/directory/<database table name>.MYI
References
MySQL Documentation: 15.1.4.1 Corrupted MyISAM Tables (http://dev.mysql.com/doc/mysql/en/Corrupted_MyISAM_tables.html)
MySQL Documentation: 14.5.2.6 REPAIR TABLE Syntax (http://dev.mysql.com/doc/mysql/en/REPAIR_TABLE.html)
MySQL Documentation: 5.6.2.1 myisamchk Invocation Syntax (http://dev.mysql.com/doc/mysql/en/myisamchk_syntax.html)
1030 - Got error 127 from table handler
This indicates the table mentioned is corrupt.
Solution
Try running a repair and optimize on the table in phpMyAdmin.1030 - Got error 28 from storage engine
Error code 28: No space left on device.This indicates the table mentioned is corrupt.
Solution
Try running a repair and optimize on the table in phpMyAdmin.1046 - No Database Selected
This indicates that either no database has been created or the wrong database name $sql_database exists in the config.php files.
Solution
Check to make sure the database has been created and the config.php file for correct database name.Warning: mysql_connect(): Access denied for user:
The following error message is shown when either the username or password is incorrect for the database connection:
FATAL ERROR: Connection to database server failed.
Warning: mysql_connect(): Access denied for user: 'username@localhost' (Using password: YES)
Solution
You will need to check with your hosting provider the username and password required to access the MySQL database and/or check the config.php file for incorrect information.Warning: mysql_connect(): Can't connect to local MySQL server through socket
The error Can't connect to ... normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket filename or TCP/IP port number when trying to connect to the server.
FATAL ERROR: Connection to database server failed.
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
Solution
The following are checks for mysql to see if it is running and setup properly.
1. Start by checking whether there is a process named mysqld running on your server host.
Use ps xa | grep mysqld on Unix or the Task Manager on Windows.
2. It might also be that the server is running, but you are trying to connect using a TCP/IP port, named pipe, or Unix socket file different from those on which the server is listening. To find out what port is used, and where the socket is, you can do:
shell> netstat -l | grep mysql
3. The grant tables must be properly set up so that the server can use them for access control.
One way to determine whether you need to initialize the grant tables is to look for a `mysql' directory under the data directory. (The data directory normally is named `data' or `var' and is located under your MySQL installation directory.) Make sure that you have a file named `user.MYD' in the `mysql' database directory. If you do not, execute the mysql_install_db script. After running this script and starting the server, test the initial privileges by executing this command:
shell> mysql -u root test
4. Sometimes a simple restart of mysql will fix the problem.
References
MySQL Documentation: 5.5.8 Causes of Access denied Errors (http://dev.mysql.com/doc/mysql/en/Access_denied.html)
MySQL Documentation: A.2.2 Can't connect to [local] MySQL server (http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html)
Warning: mysql_connect(): Host '******' is not allowed
This indicates the wrong server $sql_host information in the config.php file.
FATAL ERROR: Connection to database server failed.
Warning: mysql_connect(): Host '******' is not allowed to connect to this MySQL server
Solution
Check the config.php file for incorrect information. If the error shows on secondery server, you need add secondery host '******' to the lists of access hosts of main server!Warning: Too many connections
The following error message is shown when the maximum number of connections to the database server has been reached:
FATAL ERROR: Connection to database server failed.
Warning: Too many connections in /path/to/includes/database.php on line 19 Warning: MySQL Connection Failed: Too many connections
Solution
This problem is common for shared hosting servers and requires correspondance with the server administrator.
This problem is generally not a fault of MFHS, but can be experienced when MFHS is installed on budget hosting servers.