Answer the question
In order to leave comments, you need to log in
mysql problem. What about him?
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 ''www.ebalv.ru'.* TO 'ebalv'@'localhost' WITH GRANT OPTION' at line 1
PHP:
mysql_query("GRANT ALL PRIVILEGES ON '{$website}'.* TO '{$user}'@'localhost' WITH GRANT OPTION");if (mysql_error()) {die(mysql_error());}
Technology: nginx+php5-fpm.
Answer the question
In order to leave comments, you need to log in
Forgive me for offtopic, but I lost with relish from the site address.
the database name is written without apostrophes, in extreme cases in backticks `dbname`.*
Now there is not even a plug, but it should .. In general, how is it right?
mysql_connect('localhost','root','***');
$rand = md5($password); // $password = mt_rand(0,2000);
if (!is_dir("/home/{$user}")) { mysql_query("CREATE USER '{$user}'@'localhost' IDENTIFIED BY PASSWORD('{$rand}');");if (mysql_error ()) {die(mysql_error());}}
$ws_m = $website; mysql_query("GRANT ALL PRIVILEGES ON `{$website}`.* TO '{$user}'@'localhost' WITH GRANT OPTION;"); if (mysql_error()) {die(mysql_error());}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question