0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【lightsail】Error establishing a database connection 対応

Last updated at Posted at 2020-11-08

aws lightsail bitnamiで構築しているwordpress環境にアクセスすると、

Error establishing a database connection が発生していた。

ec2インスタンスにsshで接続して、ステータスチェック

$ sudo /opt/bitnami/ctlscript.sh status
php-fpm already running
apache not running
mysql not running

mysql が起動していないので、start してみるも、disk full が発生している模様。

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            488M     0  488M   0% /dev
tmpfs           100M  3.2M   96M   4% /run
/dev/xvda1      9.7G  9.7G  2.3M 100% /
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
/dev/loop0       98M   98M     0 100% /snap/core/9993
/dev/loop1       18M   18M     0 100% /snap/amazon-ssm-agent/1566
/dev/loop2       29M   29M     0 100% /snap/amazon-ssm-agent/2012
/dev/loop3       97M   97M     0 100% /snap/core/9804
tmpfs           100M     0  100M   0% /run/user/1000

EBSボリュームを拡張後、ボリュームサイズ変更後の Linux ファイルシステムの拡張 をする

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            488M     0  488M   0% /dev
tmpfs           100M  3.2M   96M   4% /run
/dev/xvda1       20G  9.7G  9.7G  51% /
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
/dev/loop0       98M   98M     0 100% /snap/core/9993
/dev/loop1       18M   18M     0 100% /snap/amazon-ssm-agent/1566
/dev/loop2       29M   29M     0 100% /snap/amazon-ssm-agent/2012
/dev/loop3       97M   97M     0 100% /snap/core/9804
tmpfs           100M     0  100M   0% /run/user/1000

startして、mysqlが起動したことを確認した

$ sudo /opt/bitnami/ctlscript.sh start
php-fpm already running
apache not running
mysql already running

FYI

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?