Problem Connecting to MySQL from AS

Hi friends,

I have Windows XP running IIS in 192.168.1.100, and I'm using ASP.NET to connect to a MySQL DB in a Linux computer at 192.168.1.101.  My code is

OdbcConnection cn = new OdbcConnection("Driver={MySQL ODBC 3.51 Driver}; Server=192.168.1.101; Port=3306; Option=3; Database=Jazon; Uid=root; Password=;");
cn.Open();

I get the following error:

ERROR [HYT00] [MySQL][ODBC 3.51 Driver]Host '192.168.1.100' is not allowed to connect to this MySQL server

I have the MyODBC 3.5 driver installed in the Windows computer, and I know MySQL is running properly because I'm able to connect and query it from a PHP page in the Linux computer.

Any help would be so greatly appreciated,


Jazon from Jacksonville, FL
LVL 3
piratepatrolAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lc001trCommented:
i think you are running php code on sam machine which runs mysql server.. so u use local user to communicate with mysql you need to create a remote user ..
you need to create a user, use mysql front (http://www.mysqlfront.de) and create user and dont select localhost but write there (in the domain part) '%' which means user can use server from outside of that computer or change rules for root user.. make it % not localhost

user data is saved under a table in mysql =>  database > mysql > users or something like that you can edit it manually too but i can tell you that using mysql front is much more simpler..

ps: if you use fedora or rh 8-9 check /etc/hosts file ..
0
piratepatrolAuthor Commented:
There's a root user in the user table.  Its Host was localhost.  I updated that to % with an update query.  I still get the same problem.  (I use this root to log in from the .aspx page).  Where am I going wrong?  This bites.
0
Lc001trCommented:
can u try to create another user and change the code from aspx ?
so try it in that way too..
and btw can you connect to mysql server from your computer (which runs aspx) with mysql front or some other clients ?  please a new user give all permissions  host = % and retry with aspx and then with mysqlfront ..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

piratepatrolAuthor Commented:
Hi Lc001tr,

I made the following insert into mysql > user ...

insert info user values ('%', 'jazon', 'pwd', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', );

In my PHP, I have

$cn = @mysql_connect("%", "jazon", "pwd");

With these, I am unable to connect to MySQL from PHP.  Any thoughts?  

Thank you so much.
0
piratepatrolAuthor Commented:
Hi Lc001tr,

I added the following line to /etc/hosts, and now it works:

127.0.0.1            %

My connection string is

$cn = @mysql_connect("%", "root", "");

I can now connect to MySQL from PHP again.  However, I now have a new problem with my connection from my aspx page:

ERROR [HYT00] [MySQL][ODBC 3.51 Driver]Access denied for user: 'root@192.168.1.100' (Using password: NO)

192.168.1.100 is my Windows computer, and 192.168.1.101 is my Linux computer (with MySQL).  Any thoughts on this?

Thanks......Jazon
0
Lc001trCommented:
you can write etc/hosts file 192.168.1.0 % .. i think thats it
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.