Jump to content

Recommended Posts

Posted

Hey guys- I’m trying to access my db using the code supplied by TCH in my welcome email. This is the code, with xxxx as password (I trust you guys but, well you know :))

 

>$dbh=mysql_connect ("localhost", "xxxxxxx", "xxxxxx") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("xxxxxxx");

 

I get message saying "Access denied for user: 'xxxxx@localhost' (Using password: YES)"

 

FYI

 

The code I have from a hyperlink to the php file is as follows:

 

<a href="Greg_couponpile.php?xxx=1">

 

Is my php file saved in correct Public_html folder?

 

Hmmmmm. What am I missing?

 

Thanks!

Posted

The username and password supplied in the welcome email is for access to your cpanel and ftp. There isn't any database when you first create your account; you need to create that yourself from cpanel.

 

If you login to cpanel and go to Manage MySql you'll need to first add a db, and then add a user, then finally grant access for that user to that database. It's pretty easy to do in cpanel. That screen will then reflect your database name and username for you to use.

 

Does that help?

Posted

Thank you Lisa- its does help but you know I just realized my partner already logged into cpanel and received a dbase username/password which I correctly used. We did create a dbase and entered some test info into it.

 

Any other reason why I cannot connect?

 

Thanks!

Posted

ahhhhh. I am not. I’ve been away for the weekend and have not looked at it but I think I am just using username and password by themselves. Let me put "cPanel-name_" before password and username and see if it works. I’ll re-post.

 

Thanks!

Posted

ok I am still getting an error message saying acess is denied for user cPanel-name_xxxxx_xxxx@localhost

 

Is this what you meant by adding "cPanel-name_" to the front of username and password?

 

Thanks!

Posted (edited)

Oooops, Bruce is correct

 

Me :lol:

 

Lets say you log into cPanel with mydomai as the username, your database username will be mydomai_dbname.

Edited by TCH-Rob
Posted

hey thanks - yeah I put cPanel-name_ before just the username and left the password by itself. Still not giving me access. I double checked and name/password/db is correct.

 

I tried cpanel username and password still not giving me access.

 

hey- just read Rob's comment. My username to enter cpanel is different than the registered user for the db.

Posted
hey- just read Rob's comment. My username to enter cpanel is different than the registered user for the db.

 

Lets take my example of my cPanel login being mydomai. I am going to create a database called "datab" and a user for it called "admin" I will assign admin to the database and my login will be "mydomai_admin" as the username and the password will be whatever I called it. Remember the database name is also called "mydomai_datab" in this instance.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...