You have forgotten the password in your connection.
Try it.
mysql_connect("localhost","root" ,"password here");
Check the Documentation here .
You should switch to MYSQLI or PDO as you see that MYSQL already out of date .
The original mysql password is empty according to this information for mysql version 5.0. You must check your version.
mysql_connect("localhost","root" ,"");
EDIT:
No connection could be made because the target machine actively refused it
means there is no error in your code, but you have a firewall that blocks your connection or your system is listening in another PORT.
: 1 - check that your default connection port is 3306.
2-try to connect using "127.0.0.1" instead of "localhost", maybe it is listening on "127.0.0.1".
3. It may also go wrong if the other end is listening on UDP rather than TCP.
4- check the connection to the firewall, if allowed.
echo_Me
source share