MariaDB / Plesk Error: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded
Should you encounter the error
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceededthe first step is to analyze your MariaDB log files. You can find the location of the log files with the command
grep -R log_error /etc/mysql/*and then open the log.
nano /var/log/mysql/error.logIn my case this error occurred several times:
Aborted connection 434275 (Got an error reading communication packets)The reason might be too short execution times, so we increase the maximum execution time in PHP and additionally in the database by changing the configuration with
nano /etc/mysql/nano my.cnfand add the following content under [mysqld]:
connect_timeout = 600
net_read_timeout = 600
wait_timeout = 28800
interactive_timeout = 28800
innodb_thread_concurrency = 0 #makes everything faster
skip-name-resolve = 1 #skip name resolutionAfter that we restart the service with
service mysql restart