connect to mysql database using php on different port -


my connection string is:

    $connection = mysql_connect("localhost", "root", "") or die("could not connect db: ".mysql_error()); 

but on computer have installed iis server first localhost:80 reserved changed port 8080 changing httpd.conf file in apache folder.

now should change in connection string connect database. using xampp .

should tried writing these: 1:

  $connection = mysql_connect("localhost:8080", "root", "") or  die("could not connect db: ".mysql_error()); 

2:

$connection = mysql_connect("localhost,8080", "root", "") or    die("could not connect db: ".mysql_error()); 

but not working please. thank you

default port number mysql server uses 3306 web servers default port 80

web server , mysql server independent.

do not change api connect mysql


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -