Home WebServer PanelaaPanel Reset MySQL Root Password on aaPanel

Reset MySQL Root Password on aaPanel

by Thạch Phạm
Published: Last Updated on

In this article, AZDIGI will show you how to Recover MySQL Root Password on aaPanel. Because in some cases, you need to manipulate Root MySQL but forget or use the aaPanel Templates from the VPS provider, this information will not be provided.

Note: To ensure data safety, you should back up backup data before performing to avoid unnecessary risks in all database-related operations.

I. What is MySQL?

MySQL is the world’s most popular free and open-source database management system and is very popular with developers in application development. Because MySQL is a high-speed, stable and easy-to-use database management system that is portable, works on many operating systems, it provides a large system of very powerful utility functions. With high speed and security, MySQL is well suited for applications that access databases on the internet. Users can download MySQL for free from the homepage.

MySQL has many versions for different operating systems: Win32 version for Windows, Linux, Mac OS X, Unix, FreeBSD, NetBSD, Novell NetWare, SGI Irix, Solaris, SunOS, etc.

MySQL is one of the very basic examples of a Relational Database Management System using Structured Query Language (SQL).

MySQL is used to support Node.js, PHP, Perl, and many other languages, as a place to store information on web pages written in NodeJs, PHP or Perl, etc.

II. Reset MySQL Root Password on aaPanel

To reset the MySQL Root password on aaPanel, we can follow these 2 ways and 3 steps:

Step 1: SSH into your DirectAdmin system

To reset the MySQL Root password on aaPanel, we first need to SSH or access your VPS/server with root privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:

After successfully SSH, we continue with step 2 to change the MySQL/MariaDB configuration at my.cnf file.

Step 2: Reset MySQL Root Password

  • Cách 1: Thực hiện bằng lệnh thông qua SSH

  • Chỉnh sửa cấu hình file my.cnf

    Normally, the my.cnf configuration file will be located at /etc/my.cnf or /etc/mysql/my.cnf and on aaPanel the file will be at /etc/my.cnf.

    To edit the configuration, we use the following command:

    AZDIGI Tutorial
    vi /etc/my.cnf

    At the content of the configuration file, press i to edit and add the content below under the [mysqld] line as shown:

    AZDIGI Tutorial
    Reset MySQL Root Password on aaPanel

    After editing, you save and restart the Mysql service with the command:

    AZDIGI Tutorial
    systemctl restart mysql

    Next, you perform Mysql password reset with the following commands:

    AZDIGI Tutorial
    mysql -u root -p   (Nhấn Enter để tiếp tục)
    flush privileges;
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';   (NewPassword là mật khẩu mới cần đổi)

    Below is the result after I run the commands:

    Reset MySQL Root Password on aaPanel

  • Cách 2: Thực thiện tại giao diện aaPanel
  • First, you need to log in to aaPanel and go to Databases => root password => enter the new root password => Submit.

    Reset MySQL Root Password on aaPanel

    So we have successfully changed the Mysql root password.

    Step 3: Check the password after changing

    To check, use the command below and enter a new password:

    AZDIGI Tutorial
    mysql -u root -p

    If you can login as shown below, you have successfully changed your password.

    Reset MySQL Root Password on aaPanel

    III. Summary

    Hopefully, this article will help you in some cases when you forget or need to recover the MySQL root password on aaPanel. If you find this helpful article, please share it widely.

    See more useful articles about aaPanel at the following link:

    If you need assistance, you can contact support in the ways below:

    Đánh giá

    Tham gia nhóm hỗ trợ Server - Hosting

    Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

    Tham gia ngay

    Bài viết cùng chuyên mục

    AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

    Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign