I’m running phpmyadmin with php5 on a debian computer in the basement, and I cannot figure out how to change the connection string. I just get the error message:
Query failed: Access denied for user ‘www-data’@’localhost’ (using password: NO)
Here’s the code that I modified from what was working when I was using 000webhost as a dev server:
<?php
$mysql_host = "192.168.1.138";
$mysql_database = "db_main";
$mysql_user = "username";
$mysql_password = "deadmantellnotales";
$con = mysql_connect($mysql_host, $mysql_user, $mysql_password);
mysql_select_db($mysql_database);
?>
None of the threads I seem to find have a php solution, I keep getting java results in my google searches that clearly say php.
Are you running the script on the same server as the mysql database? If so then use localhost. If not, use it’s IP.