FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


[RESOLVED] 'localhost' database connection error!





Phil
'localhost' database connection error!

No matter what I do, I get the above error when trying to set up a web page traffic program.
I set up the database, phpmv2.
Add myself "phil" as a user.
set the server to "localhost".
supply database password, (I assume this is the same password that another program uses to access localhost?)

I'm putting all the exact same info as another program that is working fine.

In C-panel, I can see the database, phpmv2 and "_phil" as a user

What am I doing wrong?
Bondings
Phil wrote:
'localhost' database connection error!

No matter what I do, I get the above error when trying to set up a web page traffic program.
I set up the database, phpmv2.
Add myself "phil" as a user.
set the server to "localhost".
supply database password, (I assume this is the same password that another program uses to access localhost?)

I'm putting all the exact same info as another program that is working fine.

In C-panel, I can see the database, phpmv2 and "_phil" as a user

What am I doing wrong?

The localhost is ok. The database, username and password are probably wrong.

database: phil_phpmv2
user: _phil (not sure about this)
password: ***
Phil
Here is a copy and paste from C-panel with my database info. Keep in mind the phplogger is working fine. I'm using the same password for both databases.

Databases:
phil_phplogger

Users in phplogger
phil_ (Privileges: ALL PRIVILEGES)

Connection Strings
Perl $dbh = DBI->connect("DBI:mysql:phil_phplogger:localhost","phil_","<PASSWORD HERE>");
PHP $dbh=mysql_connect ("localhost", "phil_", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("phil_phplogger");


phil_phpmv2

Users in phpmv2
phil_ (Privileges: ALL PRIVILEGES)

Connection Strings
Perl $dbh = DBI->connect("DBI:mysql:phil_phpmv2:localhost","phil_","<PASSWORD HERE>");
PHP $dbh=mysql_connect ("localhost", "phil_", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("phil_phpmv2");


Apparently, the database is created and I'm entering all the required fields (username, password) as you see above.


Now, I might add that I'm using the setup script that comes with phpMyVisits-that's the program I'm trying to install.
Thinking about it, do I need to import anything? In the setup, there is a place where the tables are created, but everytime I've done this before, I've had to import the tables.
Daniel15
Try adding a new user, and call it something like 'phplogger'. The actual username will have 'phil_' prepended to it, so it will be something like 'phil_phplogger'... I don't think that 'phil_' is a valid username
Phil
Tried that, and it still will not connect.
Phil
Fixed!
I had to put "phil_" as username and "phil_phpmv2" as the database name.

Thanks for the help guys!
Related topics
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.