dil_bert Posted June 10, 2019 Share Posted June 10, 2019 hello dear all - have issues while connecting to the mysql-db during the installation process of a wordpress. i have a root-server that is administered by my friend. i can configure all the things that need to be configured with Webadmin: in other words: on the webmin-frontend (that is the area i have to controll and configure all the stuff on the server') i get back the results -error in establishing the db-connection while running the installation script of wordpress version 5.2 what else did i try out: i run a extra script to test the connection - and i got back this here... 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: yyyyyy 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); the guess: the paths seem to be a problem - in the config by the way: the character-code is 1252 ANSI L well i want to do more tests - on the webmin-frontend (that is the area i have to controll and configure all the stuff on the server') USE yourdatabase; SHOW GLOBAL VARIABLES LIKE 'PORT'; SHOW GRANTS FOR CURRENT_USER; i get back the following results: 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; 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 well what can i do now Quote Link to comment https://forums.phpfreaks.com/topic/308834-you-have-an-error-in-your-sql-syntax-failed-execute-your-sql-code-unfortunatley/ Share on other sites More sharing options...
requinix Posted June 10, 2019 Share Posted June 10, 2019 Single quotes are for strings. The name of your database is not a string. For the file not found error it sounds like either MySQL is not running (seems to be running) or its configuration does not match what your PHP setup is expecting regarding how to connect - a socket. As a test change the host to 127.0.0.1. If it works then change it back and figure out the socket problem. Quote Link to comment https://forums.phpfreaks.com/topic/308834-you-have-an-error-in-your-sql-syntax-failed-execute-your-sql-code-unfortunatley/#findComment-1567494 Share on other sites More sharing options...
dil_bert Posted June 10, 2019 Author Share Posted June 10, 2019 1 hour ago, requinix said: Single quotes are for strings. The name of your database is not a string. For the file not found error it sounds like either MySQL is not running (seems to be running) or its configuration does not match what your PHP setup is expecting regarding how to connect - a socket . As ahellst change the host to 127.0.0.1. If it works then change it back and figure out the socket problem. hello dear Requnix - first of all - many many thanks for the quick reply great to hear from you. Well yes: i am going to check all the environment things - and i also want to replace "localhost" with 127. 0.0.1 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. In the phpinfo(); under mysqlnd section there says; active_connections 18446744073709551563 is this number normal? If not how can I reduce it? and sorry - for the bit of confusing thread-posting with the issues. I am in need of help and i try to sort out things here. regards - Quote Link to comment https://forums.phpfreaks.com/topic/308834-you-have-an-error-in-your-sql-syntax-failed-execute-your-sql-code-unfortunatley/#findComment-1567496 Share on other sites More sharing options...
requinix Posted June 10, 2019 Share Posted June 10, 2019 2 hours ago, dil_bert said: PHP Version 5.6.39 Stop what you're doing and upgrade. 2 hours ago, dil_bert said: In the phpinfo(); under mysqlnd section there says; active_connections 18446744073709551563 is this number normal? If not how can I reduce it? It's a bug, but you're running software from five years ago. Quote Link to comment https://forums.phpfreaks.com/topic/308834-you-have-an-error-in-your-sql-syntax-failed-execute-your-sql-code-unfortunatley/#findComment-1567500 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.