unable to connect to database

Having trouble installing serendipity?
saltrod
Regular
Posts: 7
Joined: Fri May 08, 2009 1:15 pm

unable to connect to database

Post by saltrod »

Hi guys.

First, thank you for a nit and great blog. We just love it. :D :)

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... :cry: :cry:

Thanks,
Kjetil
from Norway
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: unable to connect to database

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
saltrod
Regular
Posts: 7
Joined: Fri May 08, 2009 1:15 pm

Re: unable to connect to database

Post 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
abdussamad
Regular
Posts: 117
Joined: Fri Apr 21, 2006 10:11 pm
Location: Karachi, Pakistan
Contact:

Re: unable to connect to database

Post 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 :D If it doesn't then it is as garvin said and your host is an idiot :D In the latter case think about changing hosts.

BTW nordic@localhost is the username not the db name. So probably no hacking involved.
saltrod
Regular
Posts: 7
Joined: Fri May 08, 2009 1:15 pm

Re: unable to connect to database

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: unable to connect to database

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
saltrod
Regular
Posts: 7
Joined: Fri May 08, 2009 1:15 pm

Re: unable to connect to database

Post by saltrod »

Hi Garvin.

Hehe :lol: I know.. :wink:

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,
:wink: :wink:
Kjetil
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: unable to connect to database

Post by garvinhicking »

Hi!

Okay, let's hope that this will be the solution! :)

Good luck and have fun,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
saltrod
Regular
Posts: 7
Joined: Fri May 08, 2009 1:15 pm

Re: unable to connect to database

Post 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
kleinerChemiker
Regular
Posts: 765
Joined: Tue Oct 17, 2006 2:36 pm
Location: Vienna/Austria
Contact:

Re: unable to connect to database

Post 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"
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: unable to connect to database

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
saltrod
Regular
Posts: 7
Joined: Fri May 08, 2009 1:15 pm

Re: unable to connect to database

Post 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
Last edited by saltrod on Wed May 27, 2009 11:02 am, edited 1 time in total.
saltrod
Regular
Posts: 7
Joined: Fri May 08, 2009 1:15 pm

Re: unable to connect to database

Post 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
anton.aleksandrov
Posts: 2
Joined: Thu Jun 04, 2009 9:35 am

Re: unable to connect to database

Post 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.
kleinerChemiker
Regular
Posts: 765
Joined: Tue Oct 17, 2006 2:36 pm
Location: Vienna/Austria
Contact:

Re: unable to connect to database

Post 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.
Post Reply