good day @all - my name is tarifa - i am pretty new to this forum.
well today i need your help in a wordpress issue.
i thought that during the installation process the file wp-config-sample.php gets to wp-config.php - but this is not happening. - i have gathered some more infos and inights due to some tests. see the following data: - the outcome of a testscript:
Warning: mysqli_connect(): (HY000/2002): No such file or directory in /sites/www.mysite.de/tests.php on line 3
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /sites/www.mysite.de/tests.php on line 4
could not connect
see the script;
<?php
if(function_exists('mysqli_connect')){if(!($link = mysqli_connect('localhost','user','passwd','my_db'))){die('could not connect: '. mysqli_error($link));}}else{die("don't have mysqli");}
echo 'connect successfully';
mysqli_close($link);
on the webmin-frontend (that is the area i have to controll and configure all the stuff on the server')
1 USE yourdatabase;
2 SHOW GLOBAL VARIABLES LIKE 'PORT';
3 SHOW GRANTS FOR CURRENT_USER;
i get back the following results:
check the manual that corresponds to your MySQL server version for the right syntax to use near ''name of my db';
SHOW GLOBAL VARIABLES LIKE 'PORT'; SHOW GRANTS FOR CURRENT_USER' at line 1
and the following
Failed to execute SQL : SQL USE 'name of my db'; SHOW GLOBAL VARIABLES LIKE 'PORT';
SHOW GRANTS FOR CURRENT_USER; failed : You have an error in your SQL syntax;
well - i am a bit unsure what i can do now.
well - since there is no connection_error property in mysqli. i think that i have to check connection error using
if ($conn->connect_error) {
die('Connect Error: ' . $conn->connect_error);
}
btw: I have Linux Server. Apache 2.4.10, PHP Version 5.6.39 and mysqlnd 5.0.11-dev - 20120503 - installed. There are several wordpress website running on server.
do i have MySQL or MySQLi - i am not sure.
what would you do now!?
by the way: just another question.... regarding the different systems in DB-terms: we have got different systems that are available generally...
MySQL - MySQLI and PDO . if we compare the different systems then we can say.
a. The now extinct mysql library and the mysqli library are two completely different animals.
b. we may forget about mysqli - since PDO is much much better - so we should probably make use of PDO.
what do you suggest - should i ask my serveradmin that he will update & upgrade the whole system - in order to have a modern system... And then i run the mysqli_error_(function)
Question
tarifa
hello dear experts -.
good day @all - my name is tarifa - i am pretty new to this forum.
well today i need your help in a wordpress issue.
i thought that during the installation process the file wp-config-sample.php gets to wp-config.php - but this is not happening. - i have gathered some more infos and inights due to some tests. see the following data: - the outcome of a testscript:
Warning: mysqli_connect(): (HY000/2002): No such file or directory in /sites/www.mysite.de/tests.php on line 3 Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /sites/www.mysite.de/tests.php on line 4 could not connect
see the script;
on the webmin-frontend (that is the area i have to controll and configure all the stuff on the server')
1 USE yourdatabase; 2 SHOW GLOBAL VARIABLES LIKE 'PORT'; 3 SHOW GRANTS FOR CURRENT_USER;
i get back the following results:
check the manual that corresponds to your MySQL server version for the right syntax to use near ''name of my db'; SHOW GLOBAL VARIABLES LIKE 'PORT'; SHOW GRANTS FOR CURRENT_USER' at line 1
and the following
Failed to execute SQL : SQL USE 'name of my db'; SHOW GLOBAL VARIABLES LIKE 'PORT'; SHOW GRANTS FOR CURRENT_USER; failed : You have an error in your SQL syntax;
well - i am a bit unsure what i can do now.
well - since there is no connection_error property in mysqli. i think that i have to check connection error using
if ($conn->connect_error) { die('Connect Error: ' . $conn->connect_error); }
well i have to read the manpages here http://php.net/manual/en/mysqli.connect-error.php in order to learn what i need to get more insights.,
btw: I have Linux Server. Apache 2.4.10, PHP Version 5.6.39 and mysqlnd 5.0.11-dev - 20120503 - installed. There are several wordpress website running on server.
do i have MySQL or MySQLi - i am not sure.
what would you do now!?
by the way: just another question.... regarding the different systems in DB-terms: we have got different systems that are available generally...
MySQL - MySQLI and PDO . if we compare the different systems then we can say.
a. The now extinct mysql library and the mysqli library are two completely different animals.
b. we may forget about mysqli - since PDO is much much better - so we should probably make use of PDO.
see the three systems in a ASCII - Comparison..:
+---------+-------------+
| mysql | dodo |
| mysqli | donkey |
| PDO | racehorse |
what do you suggest - should i ask my serveradmin that he will update & upgrade the whole system - in order to have a modern system... And then i run the mysqli_error_(function)
Love to hear from you
regards Tarifa
Link to comment
https://www.neowin.net/forum/topic/1384033-from-mysql-mysqli-or-pdo-and-mysqliconnect_error-the-script-for-errors-in-the-db-connection/Share on other sites
6 answers to this question
Recommended Posts