Nazmart is a multi-tenant eCommerce platform that needs access to the MySQL root user in order to create and manage databases automatically for each tenant. If your hosting uses DirectAdmin, follow this guide to find or request your MySQL root username and password.
Why Nazmart Needs MySQL Root Access
Nazmart is designed to create a separate MySQL database for each store or tenant. This includes creating new databases, assigning users, setting privileges, and deleting databases when needed. These actions require MySQL root access or a user with full administrative privileges. Without this, key automation features in Nazmart will not work.
Step 1: Log in to DirectAdmin
Use your DirectAdmin panel login URL and credentials provided by your hosting company. After logging in, you will land on the dashboard. If you do not see server-level options, you may not have admin-level access.
Step 2: Check Your Access Level
In DirectAdmin, there are different access levels:
- Admin Level: full server control including database root access
- Reseller Level: partial access, mainly account and user management
- User Level: limited access, typically used for individual websites
Only Admin-level users can view or manage MySQL root settings. If you are not at the Admin level, continue to the next section to request help from your hosting provider.
Step 3: Access MySQL Root Password via SSH (For Admins)
If you have root SSH access to your DirectAdmin server, follow these steps:
- Open your SSH terminal and connect to your server as root
- Run the command:
cat /root/.my.cnf
- This file contains credentials used for system-level access. You should see:
[client]
user=root
password=your_mysql_root_password
Copy this password and use it to configure Nazmart’s database connection.
Step 4: Reset the MySQL Root Password If Needed
If the .my.cnf
file is missing or the password does not work, you can reset it by:
- Logging into the server via SSH as root
- Entering the MySQL command line:
nginxCopyEditmysql
- Then running this SQL command:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';
FLUSH PRIVILEGES;
Replace your_new_password
with a secure password of your choice. Use this new password in your Nazmart core > .env
file.
Step 5: If You Don’t Have Admin or Root Access
If you’re on shared or reseller hosting without root access, contact your hosting provider. Ask them for either:
- The MySQL root username and password
- Or a MySQL user with
ALL PRIVILEGES
on all databases andGRANT OPTION
Explain that your application, Nazmart, requires this to manage tenant databases automatically.
Updating Nazmart Configuration
Once you have the root credentials, update your .env
file in Nazmart with the following details:
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nazmart
DB_USERNAME=root
DB_PASSWORD=your_mysql_root_password
This will allow Nazmart to handle database creation, deletion, and user management automatically for each tenant.
Security Tips
- Never share your MySQL root credentials publicly
- Store your password in a secure password manager
- Only use root access for essential operations like Nazmart
- Take database backups before performing major actions
Need Help?
If you’re unsure about how to access or update these credentials, contact your hosting provider or the Nazmart support team. We’re here to make sure your installation works smoothly with the right database permissions.