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

x
  • 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 (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
0
ajmfaz
Asked:
ajmfaz
3 Solutions
 
hernst42Commented:
>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
 
riaancorneliusCommented:
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 MurrellProduct SpecialistCommented:
0

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