Restore Your WordPress Database with WP-CLI

This article is a follow up to a previous article on the process of backing up a WordPress database with wp-cli. You may want to read that article before this one.

In this article you will learn how to restore a WordPress database backup using wp-cli tool. Having this skill at your disposal is crucial for situations where you need to restore a backup in a pinch. This skill can be particularly helpful if you are testing major changes and need to revert back.

Pre-flight Check:

  • These instructions were created with a cPanel-based server in mind.
  • Command line access via SSH will be necessary to follow along.
  • The server must have WP-CLI installed, for installation directions see this tutorial.

Continue reading “Restore Your WordPress Database with WP-CLI”

How to Disable MySQL Strict Mode

MySQL’s, and MariaDB’s, strict mode controls how invalid or missing values in data changing queries are handled; this includes INSERT, UPDATE, and CREATE TABLE statements. With MySQL strict mode enabled, which is the default state, invalid or missing data may cause warnings or errors when attempting to process the query.

When strict mode is disabled the same query would have its invalid, or missing, values adjusted and would produce a simple warning. This may seem like the preferred result, however with strict mode disabled certain actions may cause unexpected results; for instance, when the value being inserted exceeds the maximum character limit it will be truncated to fit the limit. Continue reading “How to Disable MySQL Strict Mode”

Database Backup and Restore in Plesk 12.5

Earlier versions of Plesk required the use of database management tools to dump databases, but Plesk 12.5 allows you to back up (by exporting a database dump as an SQL file) and restore them (by importing a database dump as an SQL file) without having to leave the control panel.

Step #1: Export a Database

  1. Select Websites & Domains from Plesk’s main menu.
  2. Select Databases, then scroll down to the panel for the database you wish to export.
  3. In the panel for your desired database, click the Export Dump icon and select a destination for the backup file. By default, it will be stored in the selected subscription’s home directory.

Step #2: Import a Database

  1. Select Websites & Domains from Plesk’s main menu.
  2. Select Databases, then scroll down to the panel for the database you wish to export.
  3. In the panel for your desired database, click the Import Dump icon browse to the backup file’s location (locally or on the server), and click the OK button.
Note: To avoid potential data loss, never attempt to restore a database without first backing up the existing database with a unique filename.

Change a Password for PostgreSQL on Linux via Command Line

PostgreSQL supports many client authentication methods, but in this case we’re only going to concern ourselves with two: password and md5.

Note: The default authentication method for PostgreSQL is ident. If you’d like to change the PostgreSQL authentication method from ident to md5, then visit the linked tutorial!

Continue reading “Change a Password for PostgreSQL on Linux via Command Line”

Change PostgreSQL Authentication Method from Ident to MD5

PostgreSQL supports multiple client authentication methods including: trust, reject, md5, password, gss, sspi, krb5, ident, peer, ldap, radius, cert, and pam. Here we’re only going to concern ourselves with two: ident and md5.

Continue reading “Change PostgreSQL Authentication Method from Ident to MD5”

What is the Default Password for PostgreSQL?

When connecting to PostgreSQL on Linux for the first time many admins have questions, especially if those admins are from the MySQL world.

By default, when PostgreSQL is installed, a postgres user is also added.

If you run the command:

cat /etc/passwd

… you’ll see the postgres user.

Continue reading “What is the Default Password for PostgreSQL?”

How to Install and Connect to PostgreSQL on Fedora 22

PostgreSQL (pronounced ‘post-gres-Q-L’) is a free, open-source object-relational database management system (object-RDBMS), similar to MySQL, and is standards-compliant and extensible. It is often used as a back-end for web and mobile applications. PostgreSQL, or ‘Postgres’ as it is nicknamed, adopts the ANSI/ISO SQL standards together, with the revisions.

Pre-Flight Check

  • These instructions are intended specifically for installing PostgreSQL on Fedora 22.
  • I’ll be working from a Liquid Web Self Managed Fedora 22 server, and I’ll be logged in as root.

Continue reading “How to Install and Connect to PostgreSQL on Fedora 22”

View the Selected MySQL Database on Linux via Command Line

Pre-Flight Check

  • These instructions are intended for viewing the selected MySQL database via the command line.
  • I’ll be working from a Liquid Web Core Managed CentOS 7 server, and I’ll be logged in as root.

Continue reading “View the Selected MySQL Database on Linux via Command Line”