Home WebServer PanelaaPanel Fix MySQL connection lost error on aaPanel

Fix MySQL connection lost error on aaPanel

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

When using aaPanel, many people will often encounter the case that the website is operating normally and suddenly encounters an error message that cannot connect to the MySQL database. On WordPress, this error will show up with the message “Error establishing a database connection“.

The reason is that when installing the MySQL or MariaDB software package into aaPanel, it will automatically calculate the MySQL database configuration based on the amount of RAM on the server and often MySQL will use more RAM than expected.

To fix this error, go to App Store => MySQL and press the Settings button.

CleanShot 2021 06 15 at 14.31.15

Next, click Optimization.

CleanShot 2021 06 15 at 14.32.11

If your VPS has 3GB of RAM or more, you can select the Optimization plan item that matches the amount of RAM you want to allocate to MySQL. The RAM used for MySQL should only be about 40% of the total RAM available on the server.

CleanShot 2021 06 15 at 14.33.25

In case the VPS you use has about 1-2GB of RAM, you should adjust the parameters manually, lowering all the parameters so that the Max RAM usage section shows using about 300MB to 500MB is reasonable.

After you have selected the parameters, you return to the Service menu and proceed to restart MySQL.

Refer to the top VPS service in Vietnam here!

Wishing you success!

Đá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