Код: Выделить всё
$databaseName = sprintf("%s_%s", substr($this->user, 0, 8), $installationData['worldId']);
// Create database with $databaseName $dbPassword
echo shell_exec("mysql -u root -p'testkmc123' -e \"CREATE DATABASE IF NOT EXISTS `$databaseName`\"");
echo shell_exec("mysql -u root -p'testkmc123' -e \"CREATE USER {$databaseName} IDENTIFIED BY '{$dbPassword}'\"");
echo shell_exec("mysql -u root -p'testkmc123' -e \"GRANT ALL PRIVILEGES ON {$databaseName}.* TO {$databaseName}\"");
я все перепробовал без надежды
ошибок получаю
Код: Выделить всё
mysql: [Warning] Using a password on the command line interface can be insecure.
Jul 29 17:04:44 alma-vps.local runTasks.php[109697]: ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to us>
Jul 29 17:04:44 alma-vps.local runTasks.php[109698]: mysql: [Warning] Using a password on the command line interface can be insecure.
Jul 29 17:04:44 alma-vps.local runTasks.php[109698]: ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to us>
Jul 29 17:04:44 alma-vps.local runTasks.php[109699]: mysql: [Warning] Using a password on the command line interface can be insecure.
Jul 29 17:04:44 alma-vps.local runTasks.php[109699]: ERROR 1064
Подробнее здесь: https://stackoverflow.com/questions/788 ... n-of-mysql