CRO8 Posted April 16, 2004 Posted April 16, 2004 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! Quote
LisaJill Posted April 16, 2004 Posted April 16, 2004 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? Quote
CRO8 Posted April 16, 2004 Author Posted April 16, 2004 ok thanks Lisa- I'll follow your instructions and re-post with my progress. Thanks! CRO8 Quote
CRO8 Posted April 16, 2004 Author Posted April 16, 2004 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! Quote
TCH-Rob Posted April 16, 2004 Posted April 16, 2004 are you using cPanel-name_username and cPanel-name_password in your configuration? Quote
CRO8 Posted April 19, 2004 Author Posted April 19, 2004 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! Quote
CRO8 Posted April 19, 2004 Author Posted April 19, 2004 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! Quote
TCH-Bruce Posted April 19, 2004 Posted April 19, 2004 Did you try adding your "cPanel-name_" to just the user name. I don't think it should be prepended to the password just the db user name. Quote
TCH-Rob Posted April 19, 2004 Posted April 19, 2004 (edited) Oooops, Bruce is correct Me Lets say you log into cPanel with mydomai as the username, your database username will be mydomai_dbname. Edited April 19, 2004 by TCH-Rob Quote
CRO8 Posted April 19, 2004 Author Posted April 19, 2004 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. Quote
TCH-Rob Posted April 20, 2004 Posted April 20, 2004 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. Quote
CRO8 Posted April 20, 2004 Author Posted April 20, 2004 Thanks Rob- got to run to work I will get back to you later tonight. Thanks! Quote
CRO8 Posted April 20, 2004 Author Posted April 20, 2004 hey guys I'm in my dbase - thanks for everything Quote
TCH-Rob Posted April 21, 2004 Posted April 21, 2004 Glad to hear it. Keep us posted if you have further questions. Thumbs Up Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.