If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Access denied for user: sqluser@localhost

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-22-04, 06:40
infinite_root infinite_root is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Access denied for user: sqluser@localhost

Hi Linux Gurus,

I had a problem running my php script (createdb.php) on the internet which produces the following error:

Warning: MYSQL_connect():

Access denied for user: sqluser@localhost (Using PASSWORD:YES) in /home/httpd/htdocs/createdb.php on line 12

I made a database as mydbase using the ff:

>create database mydbase;
>grant all on mydbase.* sqluser@localhost identified by 'passwd';
>\q

I can open and can successfully login using the credentials i made:

#mysql -u sqluser mydbase -p
Password: ******
mysql>


But why is it, I got the error access denied? Also, I can open the database using phpMyAdmin.

Hope you can help me. I am already stuck for a week now.

Thanks and more power.
Reply With Quote
  #2 (permalink)  
Old 04-22-04, 08:17
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
Re: Access denied for user: sqluser@localhost

If you are using mysql 4.1 or newer you might have to use OLD_PASSWORD when you are setting a password for a user that you want to access via php.

See the docs on MySQL site for more info, or check out my post here:

http://www.sitepoint.com/forums/showthread.php?t=145325

Quote:
Originally posted by infinite_root
Hi Linux Gurus,

I had a problem running my php script (createdb.php) on the internet which produces the following error:

Warning: MYSQL_connect():

Access denied for user: sqluser@localhost (Using PASSWORD:YES) in /home/httpd/htdocs/createdb.php on line 12

I made a database as mydbase using the ff:

>create database mydbase;
>grant all on mydbase.* sqluser@localhost identified by 'passwd';
>\q

I can open and can successfully login using the credentials i made:

#mysql -u sqluser mydbase -p
Password: ******
mysql>


But why is it, I got the error access denied? Also, I can open the database using phpMyAdmin.

Hope you can help me. I am already stuck for a week now.

Thanks and more power.
Reply With Quote
  #3 (permalink)  
Old 04-26-04, 00:53
infinite_root infinite_root is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Quote:
Originally Posted by guelphdad
If you are using mysql 4.1 or newer you might have to use OLD_PASSWORD when you are setting a password for a user that you want to access via php.

See the docs on MySQL site for more info, or check out my post here:

http://www.sitepoint.com/forums/showthread.php?t=145325
I am using mysql-4.0.16-1, does the procedure still apply?

The procedure you gave indicates updating "OLD_PASSWORD", sorry for
my ignorance, but I am accessing a newly created database, does it still imply to my problem? But I dont have OLD_PASSWORD for this matter.

Please help Iam already stuck.

Thanks and more power.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On