PDA

View Full Version : Database Connection HELP CPANEL


phil2564
02-05-2006, 10:58 PM
I have done dozens of these installs on all different installs but never on cpanel. And I am going crazy tring to get the db setup.

So I went to install page and now I am at Database Settings
well I set up a db in cpanel and called it "mydbsite" and made a user "mydbuser" and a pass "mydbpass"

Now cpanel seems to ad in front of all the parameters "sbus_" in the mysql db part.

In phplinkdirectory I inserted in to:
HOST = "localhost"
USERNAME = "mydbuser"
Password = "mydbpass"
Database = "mydbsite"

And I get back this error:
The database server returned the following message:
Access denied for user: 'mydbuser@localhost' (Using password: YES)

Then I tried it like this adding the "sbus_"
In phplinkdirectory I inserted in to:
HOST = "localhost"
USERNAME = "sbus_mydbuser"
Password = "sbus_mydbpass"
Database = "sbus_mydbsite"

And I got the same error except the added the "sbus" in front.
Access denied for user: 'sbus_mydbuser@localhost' (Using password: YES)

HELP HELP Does Cpanel have something special for a setup I a missing.

David
02-05-2006, 11:19 PM
It sound to me as if there is a small typo or something.

Psyclones
02-06-2006, 08:54 AM
In mysql databases within your cpanel have you added the user to the database?

I had the same problems a while ago.

the steps i took where

1 create database
2 create user
3 add user to database


hope this helps
Psyclones

Boby
02-06-2006, 10:13 AM
Access denied for user: 'mydbuser@localhost' (Using password: YES)

This error is cause eighter when trying to access the DB with a user+password for wich user is no password set, or you don't have a user created for that database.

Boby

mikedippel
02-06-2006, 01:36 PM
Content visible to registered users only.

Simly give user sbus_mydbuser access to database sbus_mydbsite and it should work. This is done on the same page where you created the user and database for mysql.

Kevuk2k
02-06-2006, 04:28 PM
Content visible to registered users only.

This is a very common problem that is not really a problem. The ONLY reason why this happens with a mySQL database is that you have not associated the correct username and password with the new database, the easy way to see this is to go through your cPanel, click on the myAQL icon, look at which database you want to use, (That's if you have more than one?) and then you will see directly underneath the database name the username, for example yours_database

thedatabase_xxxxxxx
Users in thedatabase
Username_XXXXXXX (Privileges: ALL PRIVILEGES)

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

Of course you will know the password that goes with the username, it looks like you probably haven't 'associated' the username with the particular database you want to use?

Good luck.

Kev

Optimit
02-06-2006, 04:47 PM
Content visible to registered users only.

This all correct except the password. Try it without the prefix on the password.

it should look,like this.

HOST = "localhost"
USERNAME = "sbus_mydbuser"
Password = "mydbpass"
Database = "sbus_mydbsite"

At least that is how I have always used it on cpanel hosting servers.