A Database Error Occurred

2019-08-28 23:06发布

问题:

Unable to connect to your database server using the provided settings.

Filename: C:\wamp\www\bdwey-flowrank-f557ab5e422d\system\database\DB_driver.php

Line Number: 124

where the problem, please help?

DB setting is correct

$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = 'sqlpass';
$db['default']['database'] = 'myDBName';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;`

and when remove password from $db['default']['password'] = ''; generate this error

A Database Error Occurred

Error Number: 1017

Can't find file: '.\flowrank\use@0009rs.frm' (errno: 22)

SELECT items.image, CONCAT(users.fname,' ',users.lname) AS full_user_name, competition.competition_id,competition.title,competition.votes FROM items AS items LEFT JOIN competitions AS competition ON competition.competition_id = items.competition_id LEFT JOIN users AS users ON competition.user_id = users.user_id GROUP BY items.competition_id ORDER BY items.votes ASC LIMIT 5

Filename: C:\wamp\www\bdwey-flowrank-f557ab5e422d\system\database\DB_driver.php

Line Number: 330

Where the problem?

回答1:

Looks like the problem is not a code problem but your MySQL server.

Try repairing your mysql tables. Have a read here: http://dev.mysql.com/doc/refman/5.0/en/rebuilding-tables.html