Блог

MySQL Root Password — Simple & Complete Guide

October 24, 2026 3 мин чтения

MySQL Root Password — Simple & Complete Guide

Use this page to set or change the server’s database root password for MySQL® or MariaDB®. This password controls full access to every database on the server, so keep it strong and private.

Critical:

  • Anyone with the root database password can access all databases.
  • Do not hand-edit stored credential files. Use the interface provided.
  • Avoid special characters (e.g., *, .) in the root password; some tools may fail to authenticate if used.

Where the Password Is Stored

The system keeps the database root password in a protected configuration file for command-line tools to use.

Нужна лучшая цена на серверные лицензии?

Получите cPanel, DirectAdmin, LiteSpeed и другое с мгновенной доставкой и поддержкой 24/7.

/root/.my.cnf

Do not edit this file manually. The interface updates it for you when you change the password.

Set a New Root Password

  1. Open the password page for the database server.
  2. Enter the new password in both fields.
  3. Check the strength meter; aim for a very strong score.
  4. (Optional) Click Password Generator to create a strong value.
    Note: If a generator offers character options, choose numbers only to avoid symbols that can break some tools.
  5. Click Change Password and wait for confirmation.

Password Strength Tips

  • Use at least 16+ characters.
  • Mix numbers and letter case if symbols are restricted.
  • Never reuse passwords from other systems.
  • Rotate the root password when staff or automation changes.

Verify from Shell (Optional)

After changing the password, you can test locally:

# As root, should connect without prompting (uses /root/.my.cnf)
mysql -e 'SELECT VERSION() AS version;'

Remote MySQL or MariaDB

If your database server is remote, decide whether you are changing the local server’s stored credentials or the remote server’s actual root password.

  • Changed on the hosting server (credentials only): Update the stored password so tools can reach the remote DB. The remote server’s actual root password must match.
  • Changed on the remote DB server: After you change it there, update the stored password on the hosting server so future connections succeed.

If both ends are under your control, keep the stored password and the remote server’s root password synchronized.

Common Issues

  • phpMyAdmin login fails: Remove special characters from the password; regenerate using numbers only if required.
  • CLI prompts for password: The /root/.my.cnf file might be out of date. Re-save the password via the interface.
  • Remote auth fails: Confirm the remote server’s root password matches what’s stored locally and that network/firewall access is open.

Summary

  • Change the database root password from the provided interface—do not edit files directly.
  • Use a long, strong password and avoid special characters if tools require it.
  • For remote servers, keep stored credentials and the remote root password in sync.
  • Test with a quick version query to confirm success.

Поделиться:

Похожие статьи

Вам также может понравиться

Готовы экономить на лицензиях ПО?

Присоединяйтесь к тысячам хостинг-провайдеров, которые доверяют SharedLicense оптовые цены и мгновенную доставку.