Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2009
    Posts
    4

    Unanswered: DBI connect failed: Access denied for user

    I have a server running the following:

    - Red Hat Enterprise Linux ES release 4
    - MySQL-server-community-5.1.34-0.rhel4
    - perl-5.8.5-36.el4_6.3

    A week or so ago someone restarted the server for updates, and when it came back up, I was testing my scripts, and I get the following error:

    'DBI connect failed: .... Access denied for user'

    I am able to connect to the mysql server via command line, but I am unable to run the scripts via command line or through the web browser. Before the server was restarted everything was working correctly.

    Any suggestions/ideas?

    Thanks,
    Matt

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    it sounds to me that as part of the update your network trolls tinkered with the permissions.

    check the permissions for the specified user(s)
    you may need to GRANT permissions to users

    if you prefer you may find it easier to use MySQL Administrator (available as part of the gui tools from MySQL) to set permissions
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2009
    Posts
    4
    When I change the host from 'servername' to 'localhost' the script works correctly via the command line, with the same username/password.

    The user has permission to connect to the db through localhost, servername, and 127.0.0.1

    I even tried re-creating th users:

    mysql> GRANT ALL PRIVILEGES ON on database.* to 'user'@'server' IDENTIFIED BY 'password';
    mysql> FLUSH PRIVILEGES;

    Still no luck.

  4. #4
    Join Date
    Jun 2009
    Posts
    4
    After flusinging the privileges when i re-created the user, I am getting this now:

    'Host 'servername' is not allowed to connect to this MySQL server...'

    I have tried setting the username/password to both root and the other username. Both have permissions to connect to the MySQL server at servername, localhost, 127.0.0.1

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    GRANTing permissions at the command line seems a klunky way of doing things. On the rare times I have to set up user accounts on MySQL lI tend to use MySQL Adminstrator, which szeems far easier and less prone to error for me
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Jun 2009
    Posts
    4
    I changed the hostname in the script to the IP of the server and now it works. I am still wondering why the actual hostname doesn't work.

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    captialisation?
    spelling
    hidden symbols
    spaces
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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