unable to connect to database from remote machine

Dear Masters,

I'm new to MySQL and are trying to get through with it. Need help from u masters...

Following is my network configuration...

I've installed MySQL 5.0 on machine A (192.168.1.21) with MySQL administrator 1.2.12. OS: Windows XP home edition (latest updates installed). MySQL ODBC connector driver installed on the machine and configured.
Service is running properly and I'm able to connect to the database (I've already created my database).

I've another machine B (192.168.1.212), which has Windows 2003 server, and is configured as domain controller and I'm using this machine for development (Visual studio installed, using visual basic). MySQL ODBC connector driver is installed, but while testing for connectivity using Test button it returns the error:
[MySQL][ODBC 3.51 Driver]Access denied for user 'root'@'ServerName' (using password: YES)
Following are the config settings:
Login tab:
Data Source name: myodbc
Description: ODBC driver for MySQL
Server: 192.168.1.21
username: root (this is the default MySQL user at machine A)
password: rootPassword
Connect options tab:
Port: 3306 (default port is used)
rest fields are empty.

On both machines I'm logging as administrator.

My querries are:
What MySQL does:
Is it trying to connect to windows user database and searching 'root' user or the MySQL user.
In username, which user should I put, the one on remote machine(where the database is installed) or the one on local machine. On both machines I've created root user  with same password so I suppose no confusinn.

On Windows XP machine, in firewall settings I also opened the 3306 TCP port, and then later on disabled the Firewall, but the problem remains same.

On Windows 2003 server machine I installed MySQL 5.0, but it was unable to start the service. The error message which comes after pressing Execute button:
Error no.: 1045
Access denied for user 'root'@'localhost' (Using password: YES)
Though the error is very obvious, that it is with the permissions, but again I've the same question. root is a Windows user or MySQL?
Prepare configuration is Tick marked
Write config file is Tick marked
Start service is tick marked
Apply security settings is cross marked
message:
The security settings could not be applied
Error number 1045
Access denied for user 'root'@'localhost' (Using password: Yes)

I need an answer to both problems:

Thanks
ajmfazAsked:
Who is Participating?
 
hernst42Connect With a Mentor Commented:
>Is it trying to connect to windows user database and searching 'root' user or the MySQL user.
no

>  root is a Windows user or MySQL?
a mysql user, mysql has its own authentication which is not based upon the windows authorization

See http://dev.mysql.com/doc/refman/5.0/en/user-account-management.html
0
 
riaancorneliusConnect With a Mentor Commented:
Essentially your problem is the '@localhost' part. That allows only local connections using this username, not remote from a different machine.

I suggest you read up about the way user authentication at the above link so you understand why it happens.
To fix it, create a new user using the mySQL admin tool. Make sure that you specify the host as %. This means that this user can connect from any domain / pc.

Then try connecting using the details for this new user from the networked pc.
0
 
ajmfazAuthor Commented:
hernst42: & riaancornelius:

Though the above document did helped me in understanding how MySQL handles users and security, but it did nothing to clear my problem, and it remains their. The problem seems certainly with the Windows rather than MySQL.

Need some response from Win Admin experts.

0
 
hernst42Commented:
If you get "Access denied for user 'root'@'xxxx' (Using password: Yes)" the the root user is not setup correctly in mysql or you didn't provide the correct values of user name and password. If you didn't change the initial password of mysql you first need to run mysqladmin on the server where mysqld is install and set a valid password. The ngrant permission to user mysql-users.
0
 
James MurrellConnect With a Mentor Product SpecialistCommented:
0
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.

All Courses

From novice to tech pro — start learning today.