#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0

    [MySQL][ODBC 3.51 Driver]Access denied for user '[username]'@'%' to database '[datab


    I Have a VB script which will download the data from MYSQL server with version 5.6.
    Previosuly it used work properly but when we upgraded from 5.5 to 5.6 it is giving the error.

    When I am executing the vbscript it is giving the following error:

    [MySQL][ODBC 3.51 Driver]Access denied for user '[username]'@'%' to database '[databasename]'.

    The connection string i am using is as follows:

    Conn.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=***.***.**.***;DATABASE=[databasename]; UID=[username];PASSWORD=[password]; OPTION=3"

    I also used the drivers {MySQL ODBC 5.1 Driver} and {MySQL ODBC 5.2a Driver} instead of 3.51 but still it gives the error.
    is there any connection string or driver issue.
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    Do you have the right username and password? Does the user (with that password) have rights on the database?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0
    Originally Posted by requinix
    Do you have the right username and password? Does the user (with that password) have rights on the database?
    Yeah i used the same username and password before and strange thing is that, when i am using the same creditanls to connect from MYSQL client it is connecting fine.

    I couldnot figure out, where it is going wrong
  6. #4
  7. No Profile Picture
    Stumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,409
    Rep Power
    4538
    You might want to visit mysql.com and check the latest odbc drivers and syntax. It seems to me the 3.51 ODBC driver is no longer current. Maybe you need to make changes to your connection string.

    Just guessing (and answering in case requinix is off for a long weekend or something)
    ======
    Doug G
    ======
    It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi
  8. #5
  9. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    I have the tab open to remind me to reply, I just... haven't.

    The 3.51 driver is out of date (1.5 years old) as Doug pointed out so you should upgrade if just for the sake of not running something that old when something much newer is available.

    I'm inclined to think there's a privileges problem. Can you connect from that machine using a different MySQL client (like the console or the Workbench) and, of course, the same credentials?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0
    Originally Posted by requinix
    I have the tab open to remind me to reply, I just... haven't.

    The 3.51 driver is out of date (1.5 years old) as Doug pointed out so you should upgrade if just for the sake of not running something that old when something much newer is available.

    I'm inclined to think there's a privileges problem. Can you connect from that machine using a different MySQL client (like the console or the Workbench) and, of course, the same credentials?
    Ofcourse I am able to connect from that system using MYSQL workbench using the same credentials and i have used all new drivers like odbc 5.1 and 5.2a installed in my system. Is there any other possiblity. I am missing to include in the connection string or could there any other possiblity of failure.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0
    Originally Posted by Doug G
    You might want to visit mysql.com and check the latest odbc drivers and syntax. It seems to me the 3.51 ODBC driver is no longer current. Maybe you need to make changes to your connection string.

    Just guessing (and answering in case requinix is off for a long weekend or something)
    Even i have used the new drivers like odbc5.1 and odbc5.2a .
    What would be the changes i have to make the connection string
  14. #8
  15. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    I can't think of any other reason.

    Temporarily grant access to all users %@% on all databases *.*, then connect. Assuming that works (because if it doesn't then there's something weird happening) then issue a query
    Code:
    SELECT USER(), DATABASE()
    and double-check that the values you get match what you expect them to be.

IMN logo majestic logo threadwatch logo seochat tools logo