Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    3

    Unanswered: 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.

  2. #2
    Join Date
    Mar 2004
    Posts
    480

    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

    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.

  3. #3
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •