0

http://164.138.211.154/phpmyadmin/index.php?db=database&token=token

///change database settings here
///database connection
$servername = "164.138.211.154";
$username = "user";
$password ="password";
$dbname="database";

/*

trying to connect to this phpmyadmin database(above is the link) using wamp(loclhost) and i am getting error

Warning: mysqli::__construct(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\PhpProjects\Orders\Read Csv file\check.php on line 38 Connection failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

i changed the username,pass,host address of php "config.inc" of my wamp server files but still not able to connect plz help me plz.

GolezTrol
  • 114,394
  • 18
  • 182
  • 210
Hamid Ali
  • 13
  • 1
  • 6
  • 2
    PHPMyAdmin is **not** a database – Charlotte Dunois Feb 04 '17 at 18:02
  • 2
    Dude! I'm in your database right now! Turn off your internet connection and change the passwords right away. This was .. a bit silly stupid of you!! Don't share your passwords online! Never! To prove what can happen, I created a table 'DUDEIGOTYOURPWD'. Feel free to drop it, but first change these credentials, because other people can do worse! – GolezTrol Feb 04 '17 at 18:06
  • 1
    @GolezTrol I guess that answers both my questions. – chris85 Feb 04 '17 at 18:10
  • An administrator has now censored your password in the edit history. However, it was available for quite some time, giving any random person who noticed full access to your database. You **MUST** change your database password ASAP. – ceejayoz Feb 04 '17 at 18:38
  • The configuration file you've quoted is not the correct syntax for phpMyAdmin (which is called `config.inc.php` and contains lines like `$cfg['Servers'][$i]['host'] = 'localhost';`. Aside from the fact that your database probably doesn't allow external access or is blocked by some firewall or NAT along the way, you don't seem to be editing the correct configuration file. – Isaac Bennetch Feb 11 '17 at 03:13

1 Answers1

1

This is because you are trying to access a remote database secured with ssh.

You need to login over ssh using a ssh tunnel from your server using command line.

Setting up tunneling posted by @Ólafur Waage on Connect to a MySQL server over SSH in PHP

And this one for tunneling by @Sosy

shell_exec(“ssh -f -L 3307:127.0.0.1:3306 user@remote.rjmetrics.com sleep 60 >> logfile”);  
$db = mysqli_connect(’127.0.0.1′, ‘sqluser’, ‘sqlpassword’, ‘rjmadmin’, 3307);

Links are used from: answer by @kwarunek

Community
  • 1
  • 1
Parantap Parashar
  • 1,930
  • 1
  • 14
  • 22