How to Find MySQL Root Username and Password in cPanel – A Guide for Nazmart Users

⌘K
  1. Home
  2. Docs
  3. Nazmart – Multi-Ten...
  4. Mysql Root User Configure
  5. How to Find MySQL Root Username and Password in cPanel – A Guide for Nazmart Users

How to Find MySQL Root Username and Password in cPanel – A Guide for Nazmart Users

Nazmart is a powerful multi-tenant eCommerce platform that automatically manages a separate database for each tenant website. To enable this automation, Nazmart must have access to the MySQL root user on your server.

This guide explains how you can find or request your MySQL root username and password in a hosting environment using cPanel, WHM, or SSH access.

Why Nazmart Needs MySQL Root Access

Nazmart uses dynamic database creation for every new tenant (store owner) registered through your system. For this to work, the system requires:

  • Permission to create and manage multiple MySQL databases
  • Access to assign new MySQL users for each tenant
  • The ability to drop or reset databases when tenants are deleted

These operations can only be performed using the MySQL root account or a privileged user with full administrative permissions.

Without this access, tenant onboarding and automation features may fail.

If You’re Using cPanel (Shared Hosting)

In most shared hosting environments with cPanel, you won’t have access to the MySQL root account. Instead, you only get access to individual databases through user accounts.

What You Can Do:

  • Contact your hosting provider and explain that your application (Nazmart) needs MySQL root access to manage tenant databases.
  • Request either:
    • Full root MySQL access (for VPS or dedicated hosting)
    • Or a MySQL user account with CREATE, DROP, GRANT, and ALL PRIVILEGES

If You’re Using WHM (VPS or Dedicated Hosting)

If your hosting setup includes WHM, you may have full root access to the server.

Option 1: Retrieve Root Password via SSH

  1. Log in via SSH using your root credentials.
  2. Run this command: /root/.my.cnf
  3. You’ll see output like: [client] user=root password=your_mysql_root_password

This file contains the MySQL root username (root) and the password in plain text.

Option 2: Reset Root Password via WHM Panel

If you don’t know the password or the file is missing:

  1. Log in to WHM
  2. Go to SQL Services > MySQL Root Password
  3. Enter and confirm a new password
  4. Save and use the updated password in Nazmart’s environment configuration

If You Don’t Have Root or WHM Access

If you’re using managed hosting or shared cPanel without root privileges:

  • Contact your hosting provider’s support team
  • Request them to:
    • Provide the MySQL root credentials
    • Or create a privileged MySQL user account for Nazmart
    • Grant full database privileges: ALL PRIVILEGES on *.* with GRANT OPTION

Make sure to explain that your system requires full control over database creation and user management.

Final Notes

  • MySQL root username is usually root or admin
  • Store credentials securely using a password manager
  • Update your .env file in Nazmart with the correct database host, root user, and password
  • Always keep a backup before performing critical operations

Need Help?

If you’re unsure how to proceed or need help with server setup, contact your hosting provider or reach out to the Nazmart support team for guidance.

Was this article helpful to you? No Yes

How can we help?