Tutorial: AMH panel LNMP environment MYSQL website cannot connect to the solution process

888u

Last update at :2024-05-26,Edit by888u

Tutorial:AMH PanelLNMP environment MYSQL The website cannot be connected solution process

I used the AMH panel built by Linode Tokyo VPS in Japan, and then put a blog with a low traffic volume. Today I found that the website suddenly said that it could not be opened. It is a WP blog site. The first thing to point out is that the 1G machines in Tokyo, Japan are really good at opening blog sites. LINDOE's machine introduction can be opened below: Click here to get there

The environment is: AMH4.2 free version + WP blog

WP website error message: WP database connection error, unable to link to the database

AMH panel link error message: Can 't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Mysql link error, please configure the /Amysql/config.php file

Solution process:

1. First open the WP blog root directory and view

In wp-config.php, modify these items define(‘DB_NAME’, ”);

/** MySQL database username */ define(‘DB_USER’, ”);

/** MySQL database password */ define(‘DB_PASSWORD’, ”);

2. It is found that there are no problems above, ruling out the possibility that the host file has been modified or is wrong. The next step is to troubleshoot environmental issues with the VPS.

3. Reconnect to the VPS and start mysql: amh mysql start

The following error is prompted: MySQL startup ERROR! MySQL server PID file could not be found

4. Choose to restart VPS. reboot. Found the situation to be the same. It seems that restarting the VPS cannot solve the problem. The problem is to restart MYSQL in the LMNP environment in the VPS. Finally, the reason was found: Unless there are special circumstances, the default installed LNMP one-click package environment does not close the MYSQL log, which will result in the generation of mysql-bin.0000* log files. If the website is running in the early stages, the problem may not be discovered after a long time. Will occupy the hard disk.

Solution: 1: Delete all mysql-bin.0000* log files and rm them all 2: Modify the my.cnf file, find log-bin=mysql-bin and comment it out. The binary mysql-bin.0000* log file will not be generated in the future!

At the same time, cancel the log file that configures whether to open a MYSQL account in MYSLQ.

/etc/my.cnf Edit this file and find the two lines log-bin=mysql-bin and binlog_format=mixed. Just comment out the # in front of them. Similarly, we restart MYSQL to take effect. In this way, we can solve the problem of excessive hard disk usage caused by MYSQL log files.

The above is the main process that bloggers used to solve problems when dealing with a blog this morning. It is recommended that everyone use search, or go to the AMH forum to view relevant documents, and general problems can be solved.

Recommended site searches: free virtual host, foreign website space, host discount code, all-purpose space trial, domain name registration website query, Hong Kong server rental, high-defense US server, Korean server rental, Hong Kong's best virtual host, Sichuan server rental

Tutorial: AMH panel LNMP environment MYSQL website cannot connect to the solution process

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