sql >> Base de Datos >  >> RDS >> Mysql

Reenvío de puertos Vagrant para Mysql

finalmente pude hacerlo funcionar -

edite el /etc/mysql/my.cnf archivo y asegúrese, ya sea

  • tiene bind-address = 0.0.0.0
  • o comentas la línea #bind-address ...

Es posible que deba agregarlo a la sección mysqld del archivo my.cnf:

[mysqld]
bind-address = 0.0.0.0

asegúrese de reiniciar su servidor mysql después del cambio

$ sudo service mysql restart

Luego puede conectarse desde su host, así que primero tuve un error como

$ mysql -h127.0.0.1 -P 3309 -uroot -p
Enter password:
ERROR 1130 (HY000): Host '172.16.42.2' is not allowed to connect to this MySQL server

así que volví al invitado e hice

[email protected]:~$ mysql -h127.0.0.1 -uroot -p
...
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'172.16.42.2' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Entonces no tuve problemas para conectarme desde la máquina host

$ mysql -h127.0.0.1 -P 3309 -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.5.44-0ubuntu0.12.04.1 (Ubuntu)