unable to connect to database from remote machine

Posted on 2007-07-31
Last Modified: 2008-09-08
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:

Question by:ajmfaz
    LVL 48

    Accepted Solution

    >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

    LVL 9

    Assisted Solution

    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.

    Author Comment

    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.

    LVL 48

    Expert Comment

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

    Assisted Solution

    by:James Murrell

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    A quick step-by-step overview of installing and configuring Carbonite Server Backup.
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now