0

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'...

3 Answers 3

1

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

1

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .