URGENT: Can't connect to local server through socket '/opt/bitnami/mariadb/tmp/mysql.sock'

0

Hi there, In my Lightsail-Nginx instance, MariaDB stopped suddenly sometimes and my WordPress website got the

error establishing a database connection

And when I tried to connect MariaDB on the Ubuntu console I got this error:

Can't connect to local server through socket '/opt/bitnami/mariadb/tmp/mysql.sock'

And after restarting MySQL service it's working again.

sudo /opt/bitnami/ctlscript.sh restart mysql

Thanks

질문됨 일 년 전1247회 조회
1개 답변
1
수락된 답변

You need to investigate why MariaDB keeps stopping so I suggest you do the following:

  1. From my experience, this often happens when your server's resources are saturated (i.e. out of memory, max CPU, max Disk usage, throttled networking, etc.) so review instance's performance metrics to check if it flat-lining on any of the resources mentioned (CPU, disk, networking) and for memory you may follow this guide to view the memory graphs - https://aws.amazon.com/blogs/compute/monitoring-memory-usage-lightsail-instance/ More details on reviewing Lightsail performance metrics here :

  2. Review the system logs (/var/log/syslog or /var/log/messages ), mariaDB logs and or nginx logs to find out why it is stopping frequently. I would start by searching the system log file for mariadb or mysql and then reviewing the mariadb logs themselves. Both of these should give you some insight into why the service is stopping. If you are experiencing memory issues you will likely find errors like Out of memory: kill process in your system logs.

  3. If it turns out that you are exhausting your system resources, you may need to consider increasing the size of your instance to allocate more resources for your website - https://repost.aws/knowledge-center/change-lightsail-plan

profile pictureAWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠