Change MySQL Password
The following are instructions on how to change your MySQL password from the Unix command line. Login to MySQL and access MySQL table. mysql -u root -p use mysql; Change the password for any user,...
View ArticleMass Find and Replace
There are situations when you have to do a mass find and replace on your database. Let’s say you’re really, really bad speller. You just recently found out that you’ve been spelling a word for wrongly...
View ArticleWhere Featured Images Are Stored
The WordPress Genesis theme uses featured images on its posts on several of its themes. If you’re curious as to where the Genesis theme stores the image links on the database, you’ll need to go to a...
View ArticleQuick Database Check
Here’s a quick PHP script to check if your web server can connect to your MySQL database. It’s a neat little script if you don’t have any application installed yet, and you just want to see if your web...
View ArticleRun SQL in Bash
Here’s an example on how to run MySQL commands from Bash. mysql dbname -e "UPDATE wp_options SET option_value='http://domain.com' WHERE option_name='home'"; mysql dbname -e "UPDATE wp_options SET...
View ArticleRecover MySQL Root Password
How to recover a MySQL root password without a password. Stop MySQL.Start MySQL Safe Mode.Login to MySQL as root without password.Change root password. # Stop MySQL. service mysql stop # MySQL Safe...
View ArticleMySQL Backup To S3 Bucket
Here’s my MySQL backup script to the S3 Bucket. Just a couple of things about the script. It’s using … AWS CLIMysqldump They must be setup and configured to work properly. #!/bin/bash cd...
View ArticleMySQL Restore
Here’s how to restore a MySQL database from mysqldump. mysql -u user -p mysql> drop database databasename; mysql> quit; Bye mysql -u user -p databasename < filename.sql Drop database first,...
View ArticleMySQL SSL Connection
The standard way to connect to MySQL is: mysql -h hostname -u user -p Here’s how to connect to MySQL with SSL encryption. mysql -h hostname -u user -p \ --ssl-ca=server-ca.pem \...
View ArticleMySQL Restore to another DB
In order to restore a MySQL database to another database, use routines and triggers. mysqldump -p user -p --routines --triggers db1 > db1.sql To restore to another database, just use the normal...
View Article