I am trying to connect to a database on a server that i have permission on, but not as root. I do however have permission to the database i created , but it's not in the standard directory of /var/lib/mysql/
I had to install a local user copy of it and create my own config file. also i created my own local directory for mysql because i can't use the root version, due to not being root. I'm using PHP to try to connect and this is what the page is returning
Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in mydirectory/test.php on line 6
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in mydirectory/ on line 6
Unable to select database
Here is the PHP script:
<?php
$user="myuser";
$password=
$database="demo";
mysql_connect(localhost, $user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM customers";
$result=mysql_query($query);
mysql_close();
?>
I do have a password value but i removed it.
So what could i be doing wrong?
I had to install a local user copy of it and create my own config file. also i created my own local directory for mysql because i can't use the root version, due to not being root. I'm using PHP to try to connect and this is what the page is returning
Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in mydirectory/test.php on line 6
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in mydirectory/ on line 6
Unable to select database
Here is the PHP script:
<?php
$user="myuser";
$password=
$database="demo";
mysql_connect(localhost, $user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM customers";
$result=mysql_query($query);
mysql_close();
?>
I do have a password value but i removed it.
So what could i be doing wrong?