Backing up a MySQL database on Linux

Linux commands to back up and restore MySQL database

It’s always a good idea to take frequent backups of your MySQL or MariaDB databases. They can potentially contain thousands of lines of irreplaceable data. Many users may be confused on how to back up their databases at first, as the process differs quite a bit from backing up ordinary files. The process of restoring a backup must also be known, as there’s no point in having a backup if the user cannot reliably restore it.

In this guide, we’ll go over various command line examples to back up and restore MySQL or MariaDB databases on a Linux system. You can then use these commands to make regular backups of your databases, or even add them to a Bash script that can do most of the work for you. Another option is to configure cron to make regularly scheduled backups of your databases.

In this tutorial you will learn:

  • How to back up MySQL or MariaDB database (one or multiple)
  • How to restore a MySQL or MariaDB database backup

Read more

WordPress admin menu

WordPress Installation on Ubuntu Linux with Apache and MySQL

WordPress has remained one of the best and easiest ways to get a sleek site up and running ever since its inception in 2003. As a matter of fact, current trends only show its popularity continuing to increase. WordPress is simple to use, and even hosting it yourself isn’t that hard, as we’ll prove to you in this article.

In this guide, we’ll show you how to get your site hosted with WordPress on Ubuntu Linux. We’ll use Apache as our HTTP server, and also install PHP and MariaDB (an open source implementation of MySQL) since WordPress requires them in order to function. This assortment of packages is commonly referred to as a LAMP stack (Linux, Apache, MySQL, PHP). Once those packages are installed, we’ll go over the configuration of Apache and MySQL, including initial setup of a database and user, before installing WordPress itself. Towards the end, we’ll also show you how to configure a self signed SSL certificate, or get a free one from Let’s Encrypt, which enables your site to utilize HTTPS.

In this tutorial you will learn:

  • How to install and configure Apache
  • How to install and configure MariaDB for MySQL
  • How to setup a MySQL user and database for WordPress
  • How to download and install WordPress
  • How to configure a self signed SSL certificate for your WordPress site
  • How to configure a free SSL certificate from Let’s Encrypt

Read more

Setting up a MySQL database and user on AlmaLinux

How to install MySQL on AlmaLinux

In this guide, we will show you how to install MySQL on AlmaLinux. There are two separate packages for this on AlmaLinux, depending on what you need to do. You can either install the MySQL client package, which is used to connect to MySQL servers, or install the MySQL server software, which can be used to host your own databases. We’ll cover both below.

After installing a MySQL server, we’ll also go over the first steps you’ll need to get started with hosting a database, which includes making a username and password, creating a database, and granting user permissions on that database. AlmaLinux is a good Linux distro for hosting MySQL, whether you’ve freshly installed AlmaLinux or migrated from CentOS to AlmaLinux.

In this tutorial you will learn:

  • Install MySQL Client on AlmaLinux
  • Install MySQL Server on AlmaLinux
  • How to setup a MySQL database
Setting up a MySQL database and user on AlmaLinux

Setting up a MySQL database and user on AlmaLinux

Read more

LAMP stack running successfully on AlmaLinux

How to install LAMP stack on AlmaLinux

A LAMP stack is an assortment of software that contains everything you need in order to serve a website, show dynamic content, and store or retrieve data from a database. The software is all within the LAMP acronym, namely the Linux operating system, Apache web server, MySQL database (or MariaDB alternatively), and PHP programming language.

If you’ve installed AlmaLinux or migrated from CentOS to AlmaLinux, then you already have the first requirement done. Next, you just need to get your LAMP stack up and running. In this guide, we’ll show the step by step instructions to install a LAMP stack on AlmaLinux.

In this tutorial you will learn:

  • How to install all LAMP prerequisite packages on AlmaLinux
  • How to secure MariaDB database
  • How to start httpd and MariaDB services
  • How to open HTTP and HTTPS firewall ports
LAMP stack running successfully on AlmaLinux

LAMP stack running successfully on AlmaLinux

Read more

main

Introduction to database normalization: the first three normal forms

The goal of a relational database normalization is to achieve and improve data integrity and avoid data redundancy so to avoid possible insertion, updation or deletion anomalies. A relational database is normalized by applying a series of rules called normal forms. In this article we will discuss the first three normal forms.

In this tutorial you will learn:

  • What is the first normal form
  • What is the second normal form
  • What is the third normal form
main

Read more

How to promote Mediawiki user with sysop and bureaucrat privileges

The following lines will describe a procedure on how to promote mediawiki user to sysop and bureaucrat role directly using MySQL database.

Access database

First, connect to your database using mysql client. Depending on your environment you can run something like:

$ mysql -u USER -p PASSWORD

Once you get to the MySQL command prompt select appropriate Mediawiki database. In the example below the database name is wiki:

mysql> use wiki                                                                                                      
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed

Read more

Deleting a user from MySQL

How to delete MySQL/MariaDB user

If you have an outdated or unused account in your MySQL or MariaDB database, it’s best to get rid of it. Having even one extra user is an additional vulnerability and attack surface in the database. In this guide, we’ll show you the step by the step instructions to delete a specific user from a MySQL or MariaDB database from the command line on a Linux system.

DID YOU KNOW?
If you’ve forgotten the password to a user account and need to reset it, there’s no need to delete it and start over. We have separate guides for changing a user password in MySQL and changing the root password in MySQL.

In this tutorial you will learn:

  • How to delete a user from MySQL/MariaDB database

Read more

MySQL workbench dashboard on Ubuntu Linux

Install and Configure MySQL Workbench on Ubuntu Linux

MySQL workbench is a graphical application which let us manage data and perform administrative tasks on MySQL databases. In this tutorial we will see how to install the program on Ubuntu 18.04 (Bionic Beaver) and we will perform a brief tour of some of its most basic functionalities to make your Linux system administration job easier.

In this tutorial you will learn:

  • How to install and configure MySQL workbench
  • How to create a schema and a table via MySQL workbench
  • How to crate an E.R diagram by reverse-engineering an existing schema
  • How to execute SQL queries

Read more

Reset root MySQL/MariaDB password on Ubuntu 20.04

How to reset root MySQL/MariaDB password on Ubuntu 20.04 Focal Fossa Linux

In this guide we will reset the lost root MySQL/MariaDB password on Ubuntu 20.04 Focal Fossa. This can be achieved by disabling the root authentication and longing in without the password.

In this tutorial you will learn:

  • How to reset root administrator password on MySQL 8 or higher
  • How to reset root administrator password on MariaDB 10.3 or higher
  • How to disable root authentication and login without password

Read more

Setting up a MySQL database and user on Ubuntu 20.04

Install MySQL on Ubuntu 20.04 LTS Linux

In this guide, we will show you how to install MySQL on Ubuntu 20.04 Focal Fossa. There are two separate packages for this on Ubuntu, depending on what you need to do. You can either install the MySQL client package, which is used to connect to MySQL servers, or install the MySQL server software, which can be used to host your own databases. We’ll cover both below.

After installing a MySQL server, we’ll also go over the first steps you’ll need to get started with hosting a database, which includes making a username and password, creating a database, and granting user permissions on that database.

In this tutorial you will learn:

  • Install MySQL Client on Ubuntu
  • Install MySQL Server on Ubuntu
  • How to setup a MySQL database

Read more