2

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
  • 1
    You have to provide privileges to user been used to connect to database in PHP. Grant access to that particular user. Commented 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. Commented Dec 4, 2019 at 6:45
  • You have to use MySql commands in query in PHP for creating the database and setting the privileges. Commented 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? Commented Dec 4, 2019 at 7:08

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

0

Please check out this solution for creating Database in CPANEL.

https://stackoverflow.com/a/76339678/3775083

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.