Search code examples
phpmysqlweb-applicationsservercpanel

Creating database and setting privilege in MySql dynamically


Is there a way to create a database on the online server dynamically where you can create the user and set the privilege from there it self. i tried creating a database on my cpannel dynamically using php but it shows a error message of access denied. It only shows up a option to create the database statically and allocate the rights to a particular user. this thing is to be done in PHP.


Solution

  • You have to use MySql commands in query in PHP for creating the database and setting the privileges.