2

Mysql gui tools that I use to connect to my database is sql yog

I connect use data from env laravel

If I connect with data from env localhost, it works

If I connect with data from staging server, it does not works

My env localhost like this :

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=myshop
DB_USERNAME=root
DB_PASSWORD=secret

I try in sql yog like this :

enter image description here

I use db host, db port, username and password from env to connect in sql yog like that

It works

My env server staging like this :

DB_CONNECTION=mysql
DB_HOST=xx.xxx.xx.xx
DB_PORT=3306
DB_DATABASE=myshop
DB_USERNAME=forge
DB_PASSWORD=xxxxxxxxxxxxxxx

I use the data to connect with sql yog

There exist error like this :

enter image description here

How can I solve this error?

jarlh
  • 42,561
  • 8
  • 45
  • 63
moses toh
  • 12,344
  • 71
  • 243
  • 443
  • Check this : http://faq.webyog.com/content/23/15/en/error-no-2003-can_t-connect.html – Sankar Dec 05 '17 at 08:34
  • Possible duplicate of [Error No. 2003. Can't connect to mysql server](https://stackoverflow.com/questions/19727432/error-no-2003-cant-connect-to-mysql-server) – Sankar Dec 05 '17 at 08:36

2 Answers2

0

if mysql-server on the remote server, the firstly you must be add your ip mysql conf

https://support.rackspace.com/how-to/mysql-connect-to-your-database-remotely/

Turan Zamanlı
  • 3,828
  • 1
  • 15
  • 23
0

You must use the SSH tunneling for that.

http://sqlyogkb.webyog.com/article/154-connecting-using-ssh-tunneling

Neodan
  • 5,154
  • 2
  • 27
  • 38
  • I had try it. I use ssh host, ssh port, username and password from env. But it does not work. There exist error like this : `SSH Error: FATAL ERROR: Network error: Connection timed out` – moses toh Dec 05 '17 at 08:54
  • @SuccessMan The fastest way to solve it is to contact with sysadmin (which managing this server), because the SSH can be disabled for this server, or you do not have the right login data. – Neodan Dec 05 '17 at 09:08
  • The SSH not disabled for this server. How do I login correctly? I use data from env server – moses toh Dec 06 '17 at 03:44