- Newest
- Most votes
- Most comments
It appears you're experiencing several issues with your MariaDB database after creating a new instance from a snapshot in AWS Lightsail LAMP stack. The problems you're encountering are likely related to permissions and database configuration.
The error messages indicate that the MariaDB service is unable to start due to permission issues. It can't create or write to necessary files and directories. This is evident from errors like "Permission denied" when trying to create log files or temporary files.
To resolve this issue, you should try the following steps:
-
Check the permissions of the MariaDB directories and files. Ensure that the mysql user has the necessary permissions to read and write to these locations.
-
Verify that the MariaDB service is actually running. You can use the command:
sudo systemctl status mariadb
or
sudo /opt/bitnami/ctlscript.sh status mariadb
- If the service is not running, try to start it:
sudo systemctl start mariadb
or
sudo /opt/bitnami/ctlscript.sh start mariadb
- Check the MariaDB error logs for more detailed information about why the service isn't starting:
sudo tail -f /opt/bitnami/mariadb/logs/mysqld.log
-
Ensure that the database credentials in your application's configuration (like wp-config.php for WordPress) are correct and match the credentials for the new instance.
-
If you're still unable to connect, try connecting to the database using the IP address instead of the socket:
mysql -h 127.0.0.1 -P 3306 -u root -p
If these steps don't resolve the issue, you may need to consider recreating the instance from the snapshot, as there might be some corruption in the database files or configuration.
Sources
Can not connect to mariadb after creating a new instance from a linux Lightsail snapshot | AWS re:Post
Can't access MySQL in a new instance created from a snapshot | AWS re:Post
Wordpress instance cloning with a snapshot, database connection error. What to do? | AWS re:Post
Relevant content
- asked 5 years ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Not working, the log: 2024-10-20 22:26:56 0 [Note] Starting MariaDB 11.4.3-MariaDB source revision 5ab81ffe0097a22a774957df28c5223cf0201de3 server_uid 6Ldcva7LeEW2AQgnE8mZRKRLr/Y= as process 5648 2024-10-20 22:26:56 0 [ERROR] mysqld: Can't create/write to file './ddl_recovery.log' (Errcode: 13 "Permission denied") 2024-10-20 22:26:56 0 [ERROR] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log 2024-10-20 22:26:56 0 [ERROR] Aborting
i received some errors, like: ERROR 2002 (HY000): Can't connect to server on '127.0.0.1' (115) and ERROR 2002 (HY000): Can't connect to local server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2)