mysql remote access

Mysql Install Guide

Add User

tomcat install as service 

service.bat install

How to enable remote access to MySQL server on Windows

GRANT ALL PRIVILEGES ON *.* TO ‘username’@’ip’ IDENTIFIED BY ‘password’;
FLUSH PRIVILEGES;

select user,host from mysql.user where user=’root’

虚拟机中MySQL连接问题:Lost connection to MySQL server at ‘reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql

Access to MySQL server via VirtualBox – Server Fault

The root account’s localhost-only in the vast majority of default installations, are you certain you’ve allowed it to log in from the other system? From the MySQL reference manual:

it means that there is no row in the user table with a Host value that matches the client host

So, there’s no % or 10.0.2.2 in the Host column at all. Check your current config:

select user,host from mysql.user where user='root';

You likely want to create a new root entry with the same password as you have now.

create user 'root'@'10.0.2.2' identified by 'yourpassword';
grant all privileges on *.* to 'root'@'10.0.2.2' with grant option;
flush privileges;

发表评论

电子邮件地址不会被公开。 必填项已用*标注