[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1887
  • Last Modified:

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 ( 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 (, 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
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
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:

3 Solutions
>Is it trying to connect to windows user database and searching 'root' user or the MySQL user.

>  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
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.
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.

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.
James MurrellProduct SpecialistCommented:

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now