How to Find MySQL Root Username and Password in CloudPanel – 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 CloudPanel – A Guide for Nazmart Users

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

Nazmart is a multi-tenant eCommerce system that automatically creates and manages a separate database for each tenant. For this automation to work, your server must allow Nazmart to access the MySQL root account.

If you’re using CloudPanel, this guide will help you find or set your MySQL root username and password.

Why Nazmart Needs MySQL Root Access

Nazmart relies on the MySQL root user to:

  • Create new databases when a tenant registers
  • Manage database users and permissions
  • Delete databases when tenants are removed
  • Automate database-level operations

Without root access or a user with full privileges, Nazmart cannot function as intended.

Step 1: Log in to CloudPanel

Visit your CloudPanel dashboard by using the admin URL provided by your hosting provider. Log in using your administrator credentials.

Once logged in, you’ll be able to manage sites, databases, users, and server services.

Step 2: Access the Database Section

  1. Click on Databases from the left-hand menu
  2. You will see a list of your current databases and their assigned users

While you can manage individual databases here, CloudPanel does not show the MySQL root user or password in the interface.

Step 3: Connect via SSH to Access Root Password

To retrieve or reset the MySQL root password in CloudPanel, you need root access to the server via SSH.

  1. Open a terminal on your local machine
  2. Connect to your server using SSH:
ssh root@your_server_ip
  1. Once connected, view the .my.cnf file by running:
cat /root/.my.cnf
  1. You should see:
[client]
user=root
password=your_mysql_root_password

This file contains the MySQL root username and password used by the system.

Step 4: Reset the MySQL Root Password (If Needed)

If the .my.cnf file does not exist or the credentials are incorrect:

  1. Access MySQL by running:
mysql
  1. Then reset the password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';
FLUSH PRIVILEGES;
  1. Exit MySQL and store the password securely

Update the .my.cnf file with the new password if needed.

Step 5: Update Nazmart Configuration

Once you have the MySQL root credentials, configure your Nazmart core > .env file:

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nazmart
DB_USERNAME=root
DB_PASSWORD=your_mysql_root_password

This ensures Nazmart can manage tenant databases dynamically without manual input.

Security Best Practices

  • Never share your root password publicly
  • Store passwords securely using a password manager
  • Grant root access only to trusted systems like Nazmart
  • Back up databases before performing changes

Need Assistance?

If you are unsure how to retrieve or reset the root credentials, or do not have SSH access, contact your hosting provider or the Nazmart support team. We are here to help you configure your system securely and correctly.

Was this article helpful to you? No Yes

How can we help?