Lowyat.NET Forums

Welcome Guest ( Log In | Register )

LYN wins Intel-Lenovo-Tangs Blogathon challenge. Thank you everybody!
 
RSS feedBump TopicReply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> Access denied for user 'root'@'%' to database 'DB' (VB)

pu8y
post Jul 2 2009, 04:21 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #1


Getting Started
**

Group: Junior Member
Posts: 54
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jun 2006





I am running vb6 program on my pc which the MySQL database is located at another pc (fedora) connecting in the same LAN. I wrote the connection string correctly:

CODE

ConnectString = "DRIVER=(MySQL ODBC 5.1 Driver);" & _
                   "SERVER=" & "192.168.0.200" & _
                   ";DATABASE=" & "myDB" & ";" & _
                   "USER=" & "root" & _
                   ";PASSWORD=" & "root" & _
                   '";port=3306;"


However, as i execute the program an error prompt :
Runtime error '-2147467259(80004005)':
[MySQL][ODBC 5.1 Driver]Access denied for user 'root'@'%' to database 'myDB'

Before that I am using MySQL database locally which the server is 127.0.0.1, and everything works fine. The problem occurc once it is running on remote pc. Anyone knows what's wrong with my program?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ubsacc2004
post Jul 2 2009, 10:00 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #2


Regular
******

Group: Senior Member
Posts: 1,204
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Sep 2006
From: KL





do the port 3306 in fedora is open ?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
klcc212
post Jul 3 2009, 12:02 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #3


Getting Started
**

Group: Junior Member
Posts: 152
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003




You need to grant the access

refer here --> http://dev.mysql.com/doc/refman/6.0/en/con...ion-access.html
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
everling
post Jul 3 2009, 02:13 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #4


Enthusiast
*****

Group: Senior Member
Posts: 774
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Feb 2008




Perhaps the problem is that the user account is only allowed to login from '127.0.0.1' aka 'localhost'. As klcc212 pointed out, you can use the GRANT command to allow the user to login from any host or a particular host. Alternatively, you could modify the relevant `host` field in the `user` table in the `mysql` database with an SQL UPDATE statement and reset the privileges with "FLUSH PRIVILEGES;"
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
pu8y
post Jul 3 2009, 08:46 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #5


Getting Started
**

Group: Junior Member
Posts: 54
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jun 2006





QUOTE(ubsacc2004 @ Jul 2 2009, 10:00 PM)
do the port 3306 in fedora is open ?
*


Yes, I ad checked with nmapand it is opened.


QUOTE(everling @ Jul 3 2009, 02:13 AM)
Perhaps the problem is that the user account is only allowed to login from '127.0.0.1' aka 'localhost'. As klcc212 pointed out, you can use the GRANT command to allow the user to login from any host or a particular host. Alternatively, you could modify the relevant `host` field in the `user` table in the `mysql` database with an SQL UPDATE statement and reset the privileges with "FLUSH PRIVILEGES;"
*


I am using MySQL administrator and I grant the privileges to @ % (anyone), but the result still the same. sad.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
klcc212
post Jul 3 2009, 03:22 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #6


Getting Started
**

Group: Junior Member
Posts: 152
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003




can show me your result of show grants for root user in mysql on the fedora box?

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
sovietmah
post Jul 6 2009, 11:06 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #7


Getting Started
**

Group: Junior Member
Posts: 77
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Nov 2005




QUOTE(everling @ Jul 3 2009, 02:13 AM)
Perhaps the problem is that the user account is only allowed to login from '127.0.0.1' aka 'localhost'. As klcc212 pointed out, you can use the GRANT command to allow the user to login from any host or a particular host. Alternatively, you could modify the relevant `host` field in the `user` table in the `mysql` database with an SQL UPDATE statement and reset the privileges with "FLUSH PRIVILEGES;"
*



Agree with everling,
root access, only can access internally, means localhost.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Bump TopicReply to this topicTopic OptionsStart new topic
 



----debug section please ignore----
Lo-Fi Version Time is now: 23rd November 2009 - 09:14 AM
All Rights Reserved 2003-2009 Vijandren Ramadass (~living on a prayer~)