Skip to main content

Elevate account's MySQL user

Comments

9 comments

  • kadrin
    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
  • bloom360
    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
  • cPanelLauren
    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?

    You'd have to use the cPanel user account, using the API would be the best bet
    0
  • bloom360
    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
  • cPanelLauren
    This will remain open in the event anyone else has suggestions
    0
  • bloom360
    No one in cPanel knows how to elevate a MySQL user? :(
    0
  • cPanelLauren
    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
  • bloom360
    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
  • ffeingol
    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.