I'm seeing couple of errors and a 'could not connect to the database' error on one of my website. Here's is the exact error Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'dbname'@'208.109.78.142' (using password: YES) in /home/content/forum/db/mysql4.php on line 48 Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/content/forum/db/mysql4.php on line 330 Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/content/forum/db/mysql4.php on line 331 phpBB : Critical Error Could not connect to the database Code (markup): I have'nt changed anything except added a new mysql db few days before the error popped up. I also uploaded the php file from my harddisk to overwrite the error file but that did'nt solve the problem either. If anyone can help me with this please.
Well, i'm not very familiar with MySql. But base on my experience using mssql, in your cases, base on the error message, it seem that your mysql user account doesn't has any access to your db. Should you check you DB permission for your user account. Just my opinion, maybe should ask someone more expert in Mysql.
If everything seems to be very right, then the problem maybe because of long password. Keep the password under 15 characters and it will work just fine. Hope that helps.
Once again, that is only if everything seems to be very right. I am not recalling other things, as I code in many languages so its something silly but just off of my head. Hope you solve it soon. Best of luck
it basically means that user does not have access, may be because of wrong password or user does not exist. Did you create a user 'dbname'@'%'?
Thanks for the replies guys but I still can't solve the issue. Even if I can connect to the db means I need input the username/password somewhere, right? But I can't find where to do that, what file to edit? I replaced the files giving me error but still no luck. The forum was running on phpbb2. @aboxy, no I never created a 'dbname'@'%'.
@DMK well I am not aware of your setup but this link should help:http://dev.mysql.com/doc/refman/5.5/en/adding-users.html If this does not make sense,respond back with specific details .
MYSQL is not like SQL; you do not connect through a GUI (like SQL Server Management Studio). All your commands are run from a terminal session. With your site, the db password and login would have been set when it was first installed. If no one can remember the password, you can connect to the MYSQL db with the root password (if you have that handy). If you're lucky, when the database was first installed no one set the root password (the MYSQL root password is blank by default) and you can easily login as root without a password. Once logged in, the following command will list the available databases on the MYSQL server: If you get this far you should be able to readily make out the database that your site is using. Once you have that it will be easier to look at logins for that database. However, if you cannot remember any password including the root password (and no one can) you're best off reinstalling your entire site.
Thanks for the suggestions guys. I tried my best but could not get it working. I also found malicious code on some pages which means the site and db was probably hacked. I had to take the site down, will start fresh again.
Remember if your computer is affected by virus then it'll not work properly in sql server to connect database.
Are you serious dude? Don't comment unless you know what you are talking about. There is a problem in hand and let's not confuse the OP further. BTW, DB is mysql and not sql server
There may be two possibilities : 1) Either your MySQL service is not started properly so just check the services (If you are working on local computer either ask your Hosting Provider about your problem.) OR 2) Your user that you are using not having enough permission to access that DB Chek the user permission from your cPanel.
Hello all,I have bought a new laptop,But my Win XP and Database is not working.I tried my best but could not get it working. I also found malicious code on some pages which means the site and db was probably hacked. I had to take the site down, will start fresh again.But stil facing same problem.Please someone suggetion me.Thanks in advance.