Page 1 of 2
unable to connect to database
Posted: Fri May 08, 2009 1:24 pm
by saltrod
Hi guys.
First, thank you for a nit and great blog. We just love it.
Second, we have a problem with our blog/database so that each morning when I fire up my computer and goes to the website, this error message is display in my browser:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nordicpr'@'localhost' (using password: YES) in /home/nordicpr/public_html/saltrod/include/db/mysql.inc.php on line 270
Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/nordicpr/public_html/saltrod/include/db/mysql.inc.php on line 271
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/nordicpr/public_html/saltrod/include/db/mysql.inc.php on line 271
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/nordicpr/public_html/saltrod/include/db/mysql.inc.php on line 281
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/nordicpr/public_html/saltrod/include/db/mysql.inc.php on line 281
serendipity error: unable to connect to database - exiting.
First I tried to correct it by check and repair my database. This worked, and the blog displayed perfectly on my and my wife’s computer. But the next day, the same error appeared.
Then I checked the serendipity_config_local.inc.php by making me a fixperm.php file. But the serendipity_config_local.inc.php seems correct.
So right now I am out of ideas!!
Please help me...
Thanks,
Kjetil
from Norway
Re: unable to connect to database
Posted: Fri May 08, 2009 1:40 pm
by garvinhicking
Hi!
You should talk to your mysql provider, it seems it has technical problems that garbage the server files. It is definitely a MySQL issue, serendipity is unrelated.
Regards,
Garvin
Re: unable to connect to database
Posted: Sat May 23, 2009 8:42 pm
by saltrod
Hi Garvin.
I have spoken with my mysql provider and they think the problem is within the blog. Therefore there was no help in contacting them.
But what I have done is that I deleted the old blog on my server and I deleted the database that the blog used.
Then I made a new database from scratch and unzipped the serendipity Zip-file in a new folder on my server.
I then installed the blog and entered the information about my new database during the installation.
Then the blog function perfectly for about 48 hours. But when I was visiting my blog web site for a few minutes ago, the blog was down and the same error messages appeared in my browser.
But this time there is something strange in the error message.
The first line in the error message is:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nordicpr_puser'@'localhost' (using password: YES) in /home/nordicpr/public_html/saltrod/include/db/mysql.inc.php on line 270
But my data base is not called 'nordicpr_puser'@'localhost'...
Do you suppose someone can have hacked they're way into my blog and changed the information in some of the blog files??
After installation, were there some files that had to be deleted or renamed??
Hope you can help me here...
Thanks,
Kjetil
Re: unable to connect to database
Posted: Sun May 24, 2009 3:19 am
by abdussamad
saltrod wrote:Hi Garvin.
I have spoken with my mysql provider and they think the problem is within the blog. Therefore there was no help in contacting them.
But what I have done is that I deleted the old blog on my server and I deleted the database that the blog used.
Then I made a new database from scratch and unzipped the serendipity Zip-file in a new folder on my server.
I then installed the blog and entered the information about my new database during the installation.
Then the blog function perfectly for about 48 hours. But when I was visiting my blog web site for a few minutes ago, the blog was down and the same error messages appeared in my browser.
But this time there is something strange in the error message.
The first line in the error message is:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nordicpr_puser'@'localhost' (using password: YES) in /home/nordicpr/public_html/saltrod/include/db/mysql.inc.php on line 270
But my data base is not called 'nordicpr_puser'@'localhost'...
Do you suppose someone can have hacked they're way into my blog and changed the information in some of the blog files??
After installation, were there some files that had to be deleted or renamed??
Hope you can help me here...
Thanks,
Kjetil
My suggestion is that you do yourself a favor and install another mysql dependent software for a couple of days. If it works then the problem is related to s9y and you can come back here and complain

If it doesn't then it is as garvin said and your host is an idiot

In the latter case think about changing hosts.
BTW nordic@localhost is the username not the db name. So probably no hacking involved.
Re: unable to connect to database
Posted: Sun May 24, 2009 10:26 pm
by saltrod
First of all, I am not going to change host as the one I have is the cheapest on in the country.
All thought they have no idea about database and mysql, they provide a lot of other services that I need and that I have to pay extra if I use another host.
Second, I have to use the mysql provided by my host. I am not allowed to install other mysql script/programs on my server.
Third, the reason I asked about < nordicpr_puser'@'localhost > is that the word "puser" are not related to anything I know. It is correct that "nordicpr_" and "@localhost" are related to the database username. But the word "puser" is NOT part of my username or anything I have typed into the blog installation.
That's why I asked if my blog could be hacked.
It is very strange that the error message displays an error message related to the user 'nordicpr_puser'@'localhost' when the database user is something ells 'nordicpr_*****'@'localhost'
(***** = I do not want to display my db user here in the forum.)
This is the third time I have deleted the database and the blog files from my server. And the third time I have made new database and installed the blog on my server. So also the third time this error occur.
Any ideas??
Someone??
Thanks,
Kjetil
Re: unable to connect to database
Posted: Mon May 25, 2009 10:32 am
by garvinhicking
Hi!
saltrod wrote:First of all, I am not going to change host as the one I have is the cheapest on in the country.
Well, it seems you only get what you pay for
If repairing the database would make it work temporarily, there is no clue that Serendipity is reponsible for any problems.
"nordicpr_puser" seems to be the database username you entered into serendipity to use for connecting to the database. You can check the "serendipity_config_local.inc.php" file, this one contains the username, password and databasename that serendipity uses to connect to the database. Check if those are right, because momentarily serendipity complains that it cannot connect to the database with those credentials. But in the first posting you said, it did work at some point without you changing those parameters, so I currently think that your provider is having trouble with the mysql.users database table?
Regards,
Garvin
Re: unable to connect to database
Posted: Mon May 25, 2009 11:02 am
by saltrod
Hi Garvin.
Hehe

I know..
But the thing is that I have never used any username called "nordicpr_puser". I used the username "nordicpr_avis". That is why I though the blog was hacked.
But checking with my provider yesterday and today, I have found out that they made a new user in my database. They tried to help me out without saying anything to me. And that made me also believe I was hacked.
But now, I have asked my provider to fu** off

and let me handle this matter myself. And for the fourth time I have deleted everything and then installed everything once more.
So if my provider don't fu** everything up once again, I thing I have got it right this time.
So bottom line here is, I do no longer think that there is anything wrong with the blog. It was my provider messing things up for me.
Anyway, you have been very helpful. Your answers have helped me understand that my provider is to blame. I would not have expected that so soon if I have not seek help from you and the forum here.
Thanks,
Kjetil
Re: unable to connect to database
Posted: Mon May 25, 2009 11:28 am
by garvinhicking
Hi!
Okay, let's hope that this will be the solution!
Good luck and have fun,
Garvin
Re: unable to connect to database
Posted: Wed May 27, 2009 2:36 am
by saltrod
Arrrg... It did not help.
The blog displayed fine the whole same day of installation. But the very next day, the error messages was back.
Today I checked the PHPMyAdmin and I find "PMA Database ... not OK"...
What does that mean??
I also remember from the day of installation that not all tests checked out OK and green. Some of the test was yellow ... Take a look at the Installation Integrity page:
http://www.nordicproductions.no/filer/serendipity.jpg
As I don’t get any help from my provider, I have decided to fix this issue myself. But I really need some help from you guys.
And I promise Garvin, I will make it worth your while.
Thanks,
Kjetil
Re: unable to connect to database
Posted: Wed May 27, 2009 10:01 am
by kleinerChemiker
The yellow lines should be no problem. Have you opend serendipity_config_local.inc.php and checked wether username, password and database are correct or not?
The PMA database is an optional feature of PhpMyAdmin that records additional information about your schema.See
http://www.devside.net/web/server/windows/phpmyadmin under the section "[Optional] Enable phpMyAdmin's Relational Features"
Re: unable to connect to database
Posted: Wed May 27, 2009 10:11 am
by garvinhicking
Hi!
To me it sounds a lot like your custom database user/passwords are reset daily, either by you, a bad script/cronjob or the provider...
Regards,
Garvin
Re: unable to connect to database
Posted: Wed May 27, 2009 11:00 am
by saltrod
garvinhicking wrote:Hi!
To me it sounds a lot like your custom database user/passwords are reset daily, either by you, a bad script/cronjob or the provider...
Regards,
Garvin
Yes, that is was I have started to expect also.
It is not by me, so maybe a script/cronjob or my provider does this...
I will check.
Thanks,
Kjetil
Re: unable to connect to database
Posted: Wed May 27, 2009 11:01 am
by saltrod
kleinerChemiker wrote:The yellow lines should be no problem. Have you opend serendipity_config_local.inc.php and checked wether username, password and database are correct or not?
The PMA database is an optional feature of PhpMyAdmin that records additional information about your schema.See
http://www.devside.net/web/server/windows/phpmyadmin under the section "[Optional] Enable phpMyAdmin's Relational Features"
Hi.
Yes, I have.
And all info in the serendipity_config_local.inc.php is as it should be.
Thanks,
Kjetil
Re: unable to connect to database
Posted: Thu Jun 04, 2009 10:06 am
by anton.aleksandrov
Hello.
My name is Anton and I am in the hosting company, where Kjetil has his homepage. I've found this thread while trying to figure out, why his password is being regularly reset. I can assure, that we do not change user's password. Are you sure there is no other option in the code, which might change user's password? On the same server we have several hundreds other domains, but noone ever had such problem.
Anton.
Re: unable to connect to database
Posted: Thu Jun 04, 2009 10:25 am
by kleinerChemiker
Of course, it is possible to change your password. But there is only one place, where it is stored: in serendipity_config_local.inc.php. Kjetil wrote, the data in this file is correct, so it seem to be a server problem.