Jump to content

You have an error in your SQL syntax - failed execute your SQL-Code - unfortunatley


dil_bert

Recommended Posts

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 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 - ;)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.