How to modify the default MYSQL database storage path of the AMH system panel

888u

Last update at :2024-07-06,Edit by888u

Under normal circumstances, if our VPS host environment follows a panel like AMH, if there is a data disk, the website project will be stored independently in the data disk, and the system and panel environment database will be stored in the system disk, because it is also Doesn't take up much hard drive space. In the morning, a friend needed Snail's help to solve the problem of putting the AMH panel's database into the data disk. He was worried that one day the system data or cache would cause the system disk to become full.

Solution to modifying the default MYSQL database storage path of the AMH system panel

First, copy the AMH panel database to the mounting directory folder

Here Snail sees that the mounted data disk is in the HOME directory (to mount AMH, please refer to the process guide for mounting the data disk on Tencent Cloud Server and installing the AMH management panel). This is generally the case. We can put /usr/local Copy /mysql/data to the /home/mysql folder.

cp -R /usr/local/mysql/data/ /home/mysql/

Execute SSH commands in one step.

Second, create a new database directory with soft links

Execute the ln -s /home/mysql/data command in the /usr/local/mysql/ directory to create a soft link, and delete or change the old DATA database folder. It is better to change the name first.

Third, set the new MYSQL directory folder permissions

chown -R mysql:mysql mysql/

Finally, restart the VPS to solve the problem

In view of safety considerations, we still test it first and then play it on the official machine to avoid errors.

Recommended site search: China agent IP, Hong Kong server rental, host server rental, space server, free asp space, Ministry of Industry and Information Technology website registration system, vps US server, free virtual host application me domain name registration, Tencent cloud server ,

How to modify the default MYSQL database storage path of the AMH system panel

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码