Databases

chrome 7spm80ytMF - Find all WordPress installations  and export their databases

Find all WordPress installations and export their databases

This simple script will search for all wp-config.php files in a directory, pull the database name and create a backup of it. for wpinstall in $(find "$(pwd)"/ -type f -name wp-config.php | sed 's/wp-config.php//g') do echo "$wpinstall" dbname=$(grep...

chrome fv2MgTNCAE - Backup WordPress files and database via SSH

Backup WordPress files and database via SSH

This one-liner will backup your WordPress files and database into a directory name with today’s date. mkdir -p ../backup/$(date +%Y-%m-%d) ; mysqldump $(grep DB_NAME wp-config.php | grep -v WP_CACHE_KEY_SALT | cut -d \' -f 4) | gzip > ...

image 2 - [ERROR] Unknown/unsupported storage engine: InnoDB

[ERROR] Unknown/unsupported storage engine: InnoDB

MariaDB service failed due to insufficient space on /var partition. After removing the log/backup files, MySQL failed to start with the error: service mysqld status Jan 24 08:34:07 srv.pcx3.com systemd[1]: Starting MariaDB database server…Jan...

image 7 - Change the Timezone for MySQL

Change the Timezone for MySQL

Check the current timezone from MySQL: SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP); OR select now(); To check where the timezone is loaded from use: SELECT @@session.time_zone; SELECT @@global.time_zone; If it is set to SYSTEM then it is using either...

Cover Image by MilesAndryPrower on DeviantArt

Dumping specific tables in MySQL using mysqldump

For high-traffic websites, I advise developing a stagging website if you make significant updates or even switch the WordPress theme entirely. But one significant problem I encountered while moving from the staging site to the live one is that all...

Cover Image by MilesAndryPrower on DeviantArt

Auto-restart MySQL & MySQL Router if it crashes

Here is a small script that will restart the MySQL service in case it crashes. * * * * * /sbin/service mysql status || service mysql start Add it to /etc/crontab to run every minute. More complex script that does the same thing 😀 #!/bin/sh...