php - Warning: mysql_connect(): No connection could be made because the target machine actively refused it -
I am using SQLplus and zend servers when I try to run config.php, I get an error I do not know what this is because. This is the code of config.php
& lt ;? Php $ host = "jojo"; // hostname $ username = "system"; // MySQL usernameName password = "A1234"; // MySQL password $ db_name = "project_db1"; // Connect the database name to the server / server and select the database. Mysql_connect ("$ host", "$ username", "$ password") or die ("can not connect to server"); Mysql_select_db ("$ db_name") or die ("can not choose DB"); ? & Gt; I tried to change the code above and made the connection using the following code: $ conn = oci_connect ("system", " A1234 "," (description = (ADDRESS = (protocol = TCP) (host = jojo) (port = 1522)) (CONNECT_DATA = (server = dedicated) (SERVICE_NAME = orcale))));
The connection problem was resolved but now
mysql_select_db ("$ db_name") or die ("can not choose db");
This line of code is giving the same error, i "Can not make the connection target machine actively refuse it". I did not understand what the problem is, why not add it using mysql_connect
oci_connect is a separate API is -. For Oracle databases and mysql_connect, for my own MYSQL database I think that you are mixing a few things here, besides: You have forgot both the port and database in mysql_connect.
You need to use these functions especially :
Comments
Post a Comment