Results 1 to 10 of 10

Thread: Access denied for user: sqluser@localhost

  1. #1

    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

    Re:Access denied for user: sqluser@localhost

    Hi Gurus,

    An addition to my posting:
    I was able to test that I can freely access the database whenever I'm using root account. But not with the account I made? How come?

    I'm using mysql-4.0.16-1.

    Hope you guys can help me I am already stuck.

    TIA

  3. #3

    Re:Access denied for user: sqluser@localhost

    Could you please post the mysql_connect() line from your script? Also, try creating the user like this: GRANT ALL PRIVILIGES ON mysqldb.* TO 'sqluser'@'localhost' IDENTIFIED BY 'passwd'

  4. #4

    Re:Access denied for user: sqluser@localhost

    For some reason mysql started acting up and I run mysqld instead of safe_mysqld, try that.

  5. #5

    Re:Access denied for user: sqluser@localhost

    [quote author=chessforce link=board=1;threadid=9078;start=0#msg82213 date=1082720985]
    Could you please post the mysql_connect() line from your script? Also, try creating the user like this: GRANT ALL PRIVILIGES ON mysqldb.* TO 'sqluser'@'localhost' IDENTIFIED BY 'passwd'
    [/quote]

    Hi Chessforce,

    Thank you for your reply. Sorry for my typo error,

    GRANT ALL PRIVILIGES ON mysqldb.* TO 'sqluser'@'localhost' IDENTIFIED BY 'passwd'

    Also I tried something like this:
    GRANT ALL PRIVILIGES ON mysqldb.* TO 'sqluser'@'localhost' IDENTIFIED BY 'passwd WITH GRANT OPTION; GRANT ALL PRIVILEGES ON mysqldb.* TO sqluser@xxxx.domain.com IDENTIFIED BY 'password' WITH GRANT OPTION; FLUSH PRIVILEGES;

    Permission was already provided when I created the database. But still no luck ???

    Please help Iam helpless. I am stuck for many weeks now

  6. #6

    Re:Access denied for user: sqluser@localhost

    What about:

    GRANT ALL on mysqldb.* to sqluser@localhost;

    then:

    GRANT ALL on mysqldb.* to sqluser@xxxx;

    I know this isn't much different from what you have done, but the FQDN might be causing a bit of a conflict if the domain and/or DNS is not registering correctly.

    Speaking of, what are you running with? mysqld or safe_mysqld?

  7. #7

    Re:Access denied for user: sqluser@localhost

    [quote author=Master Copy link=board=1;threadid=9078;start=0#msg82353 date=1082958377]

    Speaking of, what are you running with? mysqld or safe_mysqld?

    [/quote]

    Hi Master Copy,

    Thanks for your reply.

    Sorry for my ignorance, I'm just a newbie, but how would I know if I'm running safe_mysqld?

    Thanks for your consideration.


  8. #8

    Re:Access denied for user: sqluser@localhost

    ps aux | grep mysqld

  9. #9

    Re:Access denied for user: sqluser@localhost

    [quote author=countach44 link=board=1;threadid=9078;start=0#msg82374 date=1083016921]
    ps aux | grep mysqld
    [/quote]

    Yes, I am running safe_mysqld

    Here's the result:
    0:00 /bin/sh /usr/bin/mysqld_safe --default-file=/etc/my.cnf

    Thanks and more power.

  10. #10

    Re:Access denied for user: sqluser@localhost

    Hi Gurus,

    I found that my firewall restrict my client to access my mysql server here my firewall rule:

    ACCEPT_MYSQL="yes"

    # Interface 0 MYSQL outgoing client request
    INTERFACE0_MYSQL_CLIENT="yes"

    INTERFACE0_MYSQL_OUT_SRC_IPADDR[0]=$INTERFACE0_IPADDR
    INTERFACE0_MYSQL_OUT_DST_IPADDR[0]="20x.xxx.xx.62"

    INTERFACE0_MYSQL_OUT_SRC_IPADDR[1]=$INTERFACE0_IPADDR
    INTERFACE0_MYSQL_OUT_DST_IPADDR[1]="20x.xxx.xx.61"

    # Interface 1 MYSQL outgoing client request

    INTERFACE1_MYSQL_CLIENT="yes"

    INTERFACE1_MYSQL_OUT_SRC_IPADDR[0]=$INTERFACE1_IPADDR
    INTERFACE1_MYSQL_OUT_DST_IPADDR[0]=$NETWORK1

    My Mysql LAN IP is 192.168.0.2 / 20x.xxx.xx.62 for my EXT IP.
    My client is accessing mysql both from LAN and NET.

    Hope you can help me.

Similar Threads

  1. Access denied for user: '@192.168.0.71' (Using password: NO)
    By infinite_root in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 11-20-2008, 02:10 AM
  2. Documents and Settings Folder Access Denied
    By Flip07 in forum Windows - General Topics
    Replies: 5
    Last Post: 01-07-2007, 02:25 PM
  3. Access denied
    By daypack in forum Windows - General Topics
    Replies: 1
    Last Post: 10-27-2006, 09:04 PM
  4. NFS: no security, but access denied
    By x in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 01-20-2003, 09:23 AM
  5. Access Denied
    By NewGuy in forum Linux - General Topics
    Replies: 3
    Last Post: 06-09-2002, 07:32 PM

Bookmarks

Posting Permissions

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