test environment:
mysql server ip: 192.168.56.101
client ip: 192.168.56.1
root user trying to connect from a client machine to my virtual server mysql there got the message:
ERROR 2003 (HY000) : Can not connect to MySQL server on '192 .168.56.101 '(110)
this was very strange for review by pinging visibility and could see the server from the client machine
after that I wanted to see if the port was open so that you run the command nmap on the server and could see open port 3306
the same from the client machine pointing to the server ..
the brink of collapse by decided not to understand that passing a while googling
researcher found that mysql has by default remote access we can enable disabled as follows:
in the file access the mysql server:
nano / etc / ft. cnf
in the section [mysqld] search / add
line bind-address = [ip_servidor_mysql]
and place the mysql server ip address
find if there is a line skip-networking
comment # skip-networking
recorded, close the file and restart the service
# / etc / init.d / mysql restart after this
must set the access permission from the remote client using the correct username - ipcliente, we will do this as follows:
on the server console started mysql:
$ mysql-u root-p mysql
as I go to connect from an administrative client need to give the user permissions on all databases from my client ip
mysql> GRANT ALL ON *.* TO 'root' @ '[ip_cliente]' IDENTIFIED BY '[aqui_la_clave]';
where as you can imagine [ip_cliente] is the ip of the machine from which I try to connect and [aqui_la_clave] is the user's key in my case the connection is root user you should put the user name that you used to connect
logged in
mysql mysql> exit
test the connection from the client, now we should be able to connect to the server
to find the solution use the following link:
guide mysql connection error:
http://forge.mysql.com/wiki/Error2003-CantConnectToMySQLServer
How Do I Enable Remote Access To MySQL Database Server? Http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
0 comments:
Post a Comment