Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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.