Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a mysqld server running on a windows 7 machine. How can I allow a Windows Vista machine to connect to this server?

I know I need to set some permissions using:

grant all privileges to username@ip

What should the username be? I am not sure with windows.

share|improve this question

2 Answers 2

The best practice is to first create a user, and then grant it rights...

CREATE USER 'someusername'@'someip' IDENTIFIED BY 'somepassword';
GRANT ALL ON somedb.* TO 'someusername'@'somip';

The username and password is then used in your mysql client on your pc to access the DB:

You can also create a user that can access from anywhere. To do this just use something like this:

CREATE USER 'someusername'@'%' IDENTIFIED BY 'somepassword';
GRANT ALL ON somedb.* TO 'someusername'@'%';

Important: Don't forget to put '' around strings!

share|improve this answer

'username' is username in MySQL database. Additionally MySQL by default is listening only on loopback interface (127.0.0.1/::1). Change 'bind-address' option in 'my.cnf' configuration file to IP on which you want MySQL to listen for connections. Also remember to allow traffic to port 3306 on your firewall.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.