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.
4
-
1You have to provide privileges to user been used to connect to database in PHP. Grant access to that particular user.Prabhjot Singh Kainth– Prabhjot Singh Kainth2019-12-04 06:41:39 +00:00Commented Dec 4, 2019 at 6:41
-
my question is how to create the database dynamically and then set the privilege to the user already created.Bhavin Kalal– Bhavin Kalal2019-12-04 06:45:38 +00:00Commented Dec 4, 2019 at 6:45
-
You have to use MySql commands in query in PHP for creating the database and setting the privileges.Prabhjot Singh Kainth– Prabhjot Singh Kainth2019-12-04 06:55:58 +00:00Commented Dec 4, 2019 at 6:55
-
i have tried it and it is not working. Is there any example or sample code available with you?Bhavin Kalal– Bhavin Kalal2019-12-04 07:08:10 +00:00Commented Dec 4, 2019 at 7:08
Add a comment
|