lonebyrd
Jun 4 2006, 11:39 AM
| | I'm trying to run one of my scripts on my website and its giving me this error:
QUOTE Warning: mysql_connect(): Access denied for user: 'lonebyrd_@localhost' (Using password: YES) in /home/lonebyrd/public_html/login.php on line 2 Access denied for user: 'lonebyrd_@localhost' (Using password: YES)
Is there another password for MySQL other than the one I use for my site that I just don't know how to access? |
Reply
miCRoSCoPiC^eaRthLinG
Jun 4 2006, 12:30 PM
There's something wrong with your MySQL Username.. When you create a new MySQL DB from cPanel, your database name and your db username are both prefixed with your cPanel username. For example, if your cPanel username is lbyrd, and you create a MySQL database called mydb then your actual database name (that you're supposed to use in scripts) will be lbyrd_mydb. Similarly, the username you create to access this db will be prefixed by lbyrd_ too.. for example if your username was mydbuser then the actual username to use in scripts will be lbyrd_mydbuser. If you notice that in your script your username appears only as lonebyrd_ - i.e. it contains only your cPanel username but not the actual db access username that should come after the "lonebyrd_".
Reply
lonebyrd
Jun 4 2006, 03:02 PM
I'm still not getting it to work. Maybe it's just something I'm missing but I've checked it a couple of times and I cant figure out why it's not working. Should I have to make a seperate username in my script for both my db and site? I.E. $dbusername: lonebyrd_ $username: lonebyrd
Reply
miCRoSCoPiC^eaRthLinG
Jun 4 2006, 03:18 PM
QUOTE(lonebyrd @ Jun 4 2006, 10:02 PM)  I'm still not getting it to work. Maybe it's just something I'm missing but I've checked it a couple of times and I cant figure out why it's not working. Should I have to make a seperate username in my script for both my db and site? I.E. $dbusername: lonebyrd_ $username: lonebyrd
It's not possible to say without seeing the code. Post the code here - the part that you've written to connect to the database. Also tell me your database name and the username you've created to access it. P.S. Don't forget to remove the password when you're pasting the code here.
Reply
lonebyrd
Jun 5 2006, 12:58 PM
Ok.. My database name is lonbyrd_FTV and I know the username is lonebyrd_. Here are the two codes I use: Config.php CODE <?php $user = "lonebyrd_"; $password = "password"; $database = "lonebyrd_FTV"; $host = "localhost"; ?> Login.php CODE <?php mysql_connect($user, $password, $host,) or die (mysql_error()); mysql_select_db($database) or die (mysql_error()); ?> I just thought of something. Is it because of the order I put things in my Config.php file? Well, I'm just grasping at straws, but I'll try that.
Reply
XIII
Jun 5 2006, 07:22 PM
QUOTE(lonebyrd @ Jun 5 2006, 09:58 PM)  Ok.. My database name is lonbyrd_FTV and I know the username is lonebyrd_. Here are the two codes I use: Config.php CODE <?php $user = "lonebyrd_"; $password = "password"; $database = "lonebyrd_FTV"; $host = "localhost"; ?> Login.php CODE <?php mysql_connect($user, $password, $host,) or die (mysql_error()); mysql_select_db($database) or die (mysql_error()); ?> I just thought of something. Is it because of the order I put things in my Config.php file? Well, I'm just grasping at straws, but I'll try that.
I think the code should be like this:
CODE <?php $user="lonebyrd_lonebyrd"; $password="password"; $database="lonebyrd_FTV"; $host="localhost"; ?>
but don't forget to include this file in login.php or else, how should login.php know what are username, password and database name? 
Reply
vhortex
Jun 5 2006, 08:51 PM
QUOTE(XIII @ Jun 6 2006, 03:22 AM) 
I think the code should be like this:
CODE <?php $user="lonebyrd_lonebyrd"; $password="password"; $database="lonebyrd_FTV"; $host="localhost"; ?>
but don't forget to include this file in login.php or else, how should login.php know what are username, password and database name?  Yup, I agree with XIII becoz it is clearly seent that you have put the wrong username. -- you can also use this CODE <?php $user="lonebyrd"; $password="password"; $database="lonebyrd_FTV"; $host="localhost"; ?>
which is your lonebyrd your username in the control panel and password is the control panel password. 3 Cheers!
Reply
XIII
Jun 5 2006, 11:32 PM
QUOTE(vhortex @ Jun 6 2006, 05:51 AM)  Yup, I agree with XIII becoz it is clearly seent that you have put the wrong username. -- you can also use this CODE <?php $user="lonebyrd"; $password="password"; $database="lonebyrd_FTV"; $host="localhost"; ?>
which is your lonebyrd your username in the control panel and password is the control panel password. 3 Cheers!
It's not a solution, it will not solve anything, this is the code he uses from the begining, always the username in mysql comes prefixed with Cpanel username and that's why i told him to put username_username, i would also suggest to create another user from mysql control on Cpanel, include it in this database, that will make it easier for him, also not to include configuration file in login.php 
Reply
lonebyrd
Jun 6 2006, 01:33 AM
Creating a new user and password in Cpanel for MySQl did the trick. After I did that, and included put the login.php in my script instead of a seperate file, everything worked fine. Thanks for the advice. Granted, I still have problems in my script, which I knew about, but at least my page works now.
Reply
Recent Queries:--
forget password code in php - 19.04 hr back. (1)
-
help where to put the password.php file - 29.96 hr back. (1)
-
how to put a password to a mysql database - 287.46 hr back. (1)
-
put password on a mysql database - 287.70 hr back. (1)
-
how to recover username/password public_html for mysql - 324.95 hr back. (1)
-
where put password php mysql - 353.00 hr back. (1)
-
i forgot my passowrd for mysql how can i log on - 370.03 hr back. (1)
-
mysql how do i know my password - 383.01 hr back. (1)
-
how to put password in mysql - 396.84 hr back. (1)
Similar Topics
Keywords : seperate, password, mysql
- Mysql Storage Engine Error 28
(5)
Need Help...forgot A Mysql Db Pass...
(5) Ok I forgot the password to a MySQL DB I have and would like to see if there is a way to reset the
password to it so I can use it again. Is there a Query I can run through MyPHP to clear or change
the password? Any help with this problem will be greatly appreciated...I would like to be able to
retreive a good portion of the information in this DB as it is pertinant to my website. Logan....
Where Did Mysql Go?
(2) Okay, so this morning I wen to use my forums but it says the mySQL is gone. Same with my Blog and
Image Gallery. I went to Cpanel and it says that I have no mySQL data bases. Whats wrong? Are
they really just gone forever?....
Mysql
ack... (7) Umm...I can't give to much information on whats going on or if it's happening to anybody
else...But My mysql databases are down....And this isn't the first time i've seen this
happen...Once a week or so ago it happened as I was showing my teacher my site...Not sure whats
going on exactly but the problem ended up fixing itself....So don't upload any copies of ur
databses just yet...give it a few more hours or minutes and they should be restored? not sure...Some
help from a admin would be gr8ly appreciated ....
Help! Please!
I can't get the password to work (3) I had my password copied but I copied somthing else!!! and Now the password reset email
isn't working!!! PLEASE I REALLY WANNA GET STARTED ON MY WEBBIE!! sorry,
but im so mad at myself! is there some kind of thing that only lets you reset you password once
every hour or something!....
Looking for seperate, password, mysql
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for seperate, password, mysql
|
advertisement
|
|