Technical documentation for Hovixa users detailing database creation, user provisioning, and granular SQL privilege assignment using the cPanel MySQL Database Wizard.

Managing MySQL Databases and Privileges via MySQL Database Wizard

The cPanel MySQL Database Wizard provides a sequential interface that abstracts the underlying SQL commands (CREATE DATABASE, CREATE USER, and GRANT). This workflow guarantees the correct binding of users to databases without requiring manual command-line query execution.

Phase 1: Database Creation

cPanel enforces a strict namespace convention on shared environments. Your database name is permanently prefixed with your cPanel username and an underscore (e.g., cpaneluser_). This prevents collisions across the server.

  1. Log in to cpanel.hovixa.com.
  2. Navigate to the Databases section and initialize the MySQL Database Wizard.
  3. Step 1: Create a Database. Input your desired database suffix. The system concatenates this with your prefix (producing, for example, cpaneluser_appdb).
  4. Click Next Step.

Phase 2: User Provisioning

Databases and users are distinct entities in the MySQL/MariaDB architecture. A database is inaccessible until a user is explicitly created and granted rights to it.

  1. Step 2: Create Database Users. Input a username suffix. Like the database name, this is prepended with your account username. Note: Database username strings often have strict length limits (e.g., 16 or 32 characters) depending on the engine version. Keep suffixes brief.
  2. Password: Generate a cryptographically secure password. Utilize the built-in Password Generator to meet the server's minimum strength enforcement (typically > 65).
  3. Copy and store this password in a secure vault immediately. The server hashes this string; it cannot be retrieved in plaintext later.
  4. Click Create User.

Phase 3: Privilege Assignment

You must map the new user to the database by granting specific SQL execution privileges. The principle of least privilege dictates granting only what the application explicitly requires to function.

  1. Step 3: Add User to the Database. The interface presents a matrix of specific SQL privileges (SELECT, INSERT, UPDATE, DELETE, DROP, etc.).
  2. For a standard CMS deployment (e.g., WordPress, Joomla), select the ALL PRIVILEGES checkbox.
  3. Security Implementation: If you are provisioning a user strictly for automated backup scripts, grant only SELECT and LOCK TABLES. If provisioning for a read-only reporting dashboard, grant only SELECT. Do not assign DROP or DELETE rights to non-administrative application users.
  4. Click Make Changes.

Implementation Details

  • Host Constraint: Users provisioned via this wizard are strictly bound to the localhost host definition. If your architecture requires external database connections (e.g., connecting from vm.hovixa.com to cpanel.hovixa.com), you must explicitly whitelist the remote IP address using the Remote MySQL tool in cPanel.
  • Configuration Files: When updating your application's .env or wp-config.php files, you must use the fully concatenated strings (e.g., DB_NAME=cpaneluser_appdb, DB_USER=cpaneluser_dbuser) and define the host as localhost or 127.0.0.1.
Ha estat útil la resposta? 0 Els usuaris han Trobat Això Útil (0 Vots)