0
votes

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.

1
PHPMyAdmin is not a database - Charlotte Dunois
Dude! I'm in your database right now! Turn off your internet connection and change the passwords right away. This was .. <strike>a bit silly</strike> 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
@GolezTrol I guess that answers both my questions. - chris85
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
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

1 Answers

1
votes

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 [email protected] sleep 60 >> logfile”);  
$db = mysqli_connect(’127.0.0.1′, ‘sqluser’, ‘sqlpassword’, ‘rjmadmin’, 3307);

Links are used from: answer by @kwarunek