Elevate account's MySQL user
Hi,
I am building an app on top of this: The multi tenant saas toolkit for Laravel
It needs a MySQL user with permission to create databases (all will remain under the same account)
I obviously know how to grant permissions via the GUI for an existing user to an existing database but, how can I elevate a user so that it can programatically create databases?
I tried making the account a reseller but it didn't appear to do the trick.
Many thanks!
-
PHP code to create a MYSQL database connect_error) { die("Connection failed: " . $conn->connect_error); } // Creating a database named newDB $sql = "CREATE DATABASE newDB"; if ($conn->query($sql) === TRUE) { echo "Database created successfully"; } else { echo "Error creating db: " . $conn->error; } // closing connection $conn->close(); ?>0 -
Thanks @kadrin but I still need to know how to elevate a MySQL user. I am using an existing Laravel app which already takes care of creating the databases, I am not going to code it (and don't want to hack the codebase) 0 -
Thanks @cPanelLauren However, I am using an existing app. I don't want to rebuild it. I appreciate the suggestions for alternatives but I really really need to know how to escalate a MySQL user, not workarounds please. 0 -
This will remain open in the event anyone else has suggestions 0 -
No one in cPanel knows how to elevate a MySQL user? :( 0 -
That's not the issue, the problem is that it can't be done on a cPanel user level like you're requesting. I've already explained that. The only user that can access all databases despite ownership or that can access un-owned databases is the root MySQL user. The cPanel user can create new users but you must use the API calls to do this and have it recognized by cPanel. 0 -
Notice I do NOT need to create databases or users outside of the account. I only need to keep creating them within the account, just like the cPanel user would do through the API. Is this not possible at all by elevating MySQL permissions? I tried making the account a reseller, surely there must be a way methinks? 0 -
The problem is (and I'm sure others will confirm) is that if you create a databases outside the way that cPanel wants to do it (using the GUI or the API) cPanel does not "know" about the databases. It won't show up in phpMyAdmin, it won't get backed up etc. If you don't want to work with cPanel the way that cPanel works, then it's prob. not the right platform for you. 0
Please sign in to leave a comment.
Comments
9 comments