2

I'm trying to connect to an application. There was a power failure that corrupted the hard drive, and after taking a backup from it externally, I've managed to get the application back up. Looking at the files it seems fine, the database is there too. But mysql won't connect.

I get

 Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'myuser'@'localhost' (using password: YES) in C:\wamp\www\testmysql.php on line 2

where line 2 is simply:

$link = mysql_connect('localhost','myuser','mypassword'); 

I can still access PHPMYADMIN fine, and run queries, and browse tables. But I got this when trying to browse the table action_log:

enter image description here

The error says:

SQL query:
SHOW FULL FIELDS FROM `action_log`:

MySQL said:
#29 - File '.\mypath\action_log.MYD' not found (Errcode: 2)

It's a Windows machine. Where do I find that file? And do I need to do this? Howto: MySQL InnoDB corruption auto-repair after power failure?

Edit

I should add that when I run this, it works:

$link = mysql_connect('localhost','admin',''); 

Where/how can I restore the other users? Whether by files or via DB?

4

1 回答 1

1

也许 xampp 返回默认值,并且您的 phpmyadmin 的用户名和密码是 root ......尝试连接这个:$link = mysql_connect('localhost','root','');用户名是 root 并且没有密码

于 2013-02-09T12:14:03.810 回答