Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a Mysql instance installed (not as a service) on a WinXP virtual machine (VirtualBox). I installed it from the installer with GUI on the MySql site. Everything works perfectly, but the MySql connection refuses external connections. What are the simplest steps to be able to connect to this MySql instance from outside? I use a user called 'root'...

share|improve this question

3 Answers

You have to explicitly grant access from external hosts to the user

http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

it is generally best not to use root externally

share|improve this answer

I think the default root user only has access on the local machine. This offers some sort of protection since the 'root' account in many cases has no password by default. Only users who can access the machine can administer as root (by default).

You need to create another user who can access MySql remotely. See the Adding Users page for more details on this. It is well explained there.

Note that you should be logged into Windows and MySql running.
If you will wish to access MySql when you are logged out, then you will need to install it as a service.

share|improve this answer

Using @Adam and @codinguser's answers, and assuming that VirtualBox host is 192.168.57.1:

CREATE USER 'root'@'192.168.57.1' IDENTIFIED BY 'pass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.57.1' with grant option;

Note:

  1. Assuming the machine (or virtual machine) is not accessible from the outside, you can use root with no problems.
  2. It helps if the DB has NO vulnerable/interesting data.
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.