- Requisitos:
- Ter o MySQL instalado no Servidor:
- Edite o arquivo
my.cnf:vim /etc/my.cnf- Adicione ao final do arquivo a seguinte linha:
bind-address = *.
- Reinicie o servido do mysl:
service mysqld restart.
-
Acesse o mysql e crie o usuário:
# entrando no mysql mysql -uroot -p<Senha-root-mysql> # adicione comando abaixo com a senha mysql> GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'senha_root'; mysql> FLUSH PRIVILEGES; mysql> \q;
-
No console da maquina local, tente o acesse como o seguinte comando:
# sintaxe: mysql -u USER -p<Senha-root-mysql> -P PORTA -h IP_DO_SERVER banco_db # Exemplo: mysql -u root -p -P 3306 -h 192.168.0.103 banco_db # ou de forma direta, mas insegura mysql -u root -p<Senha-root-mysql> -P 3306 -h 192.168.0.103 banco_db mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.7.22 MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
Até a próxima!
By Carlos Anders.