Is there a way to create a new MySQL database, a new MySQL user and give the new user privileges on the new database all using PHP?
You could do something like this:
mysql_connect('localhost','user',password);
mysql_query("CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';");
mysql_query("GRANT ALL ON db1.* TO 'username'@'localhost'");
mysql_query("CREATE DATABASE newdatabase");
mysql_close();
You may look at the MySQL documentation on GRANT and CREATE USER