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

Changing MySQL user password

MySQL: change user password

Have you or one of your MySQL users forgotten the password to a MySQL account? It’s very easy to reset a MySQL user password on Linux, and we’ll show you the commands and step by step instructions below.

Changing the MySQL root password is a bit more involved, so we’ve written a separate guide on how to change MySQL root password.

In this tutorial you will learn:

  • How to change MySQL user password

Read more

How to install MongoDB on Ubuntu Linux

How to install MongoDB on Ubuntu Linux

MongoDB is popular database software capable of running on a variety of systems, including Linux. In this guide, we’ll be taking you through the steps of installing MongoDB on Ubuntu Linux, as well as some basic configuration after it’s up and running.

In this tutorial you will learn:

  • How to install MongoDB
  • How to control MongoDB (start, stop, etc)
  • How to connect to MongoDB remotely
  • How to change MongoDB default port

Read more

PostgreSQL performance tuning for faster query execution

Objective

Our objective is to make a dummy query execution run faster on PostgreSQL database using only the built in tools available
in the database.

Operating System and Software Versions

  • Operating System: Red Hat Enterprise Linux 7.5
  • Software: PostgreSQL server 9.2

Requirements

PostgreSQL server base install up and running. Access to the command line tool psql and ownership of the example database.

Read more

Verifying changes with grep

How to create a hot standby with PostgreSQL

Objective

Our objective is to create a copy of a PostgreSQL database that is constantly synchronizing with the original one and accepts read-only queries.

Operating System and Software Versions

  • Operating system: Red Hat Enterprise Linux 7.5
  • Software: PostgreSQL server 9.2

Requirements

Privileged access to both master and slave systems

Read more

mariadb-mysql

Introduction to MySQL/MariaDB database SQL views

A database view is nothing but a virtual table, which does not contains data itself, but references data contained in other tables. Views are basically the result of stored queries which can vary on complexity and can be used, for example, to hide data from users, allowing access only on selected columns of a table, or simply to provide a different point of view on the existing data. In this tutorial we will see how to create, update, alter and drop a view on a MySQL, MariaDB database.

In this tutorial you will learn:

  • What is a view
  • How to create a view
  • How to update a view
  • How to alter a view
  • How to drop a view

Read more

jq-logo

How to parse a json file from Linux command line using jq

The JSON (JavaScript Object Notation) format is widely used to represent data structures, and is frequently used to exchange data between different layers of an application, or by the use of API calls. We probably know how to interact with json-formatted data with the most used programming languages such as parsing JSON with python, but what if we need to interact with it from the command line, or in a bash script? In this article we will see how we can accomplish such a task by using the jq utility and we will learn its basic usage.

In this tutorial you will learn:

  • How to install jq in the most used Linux distributions or compile it from source
  • How to use jq to parse json-formatted data
  • How to combine filters using “,” and “|”
  • How to use the length, keys, has and map functions

Read more

Results of running the application

How to persist data to PostgreSQL in Java

Java is perhaps the most widely used programming language nowadays. It’s robustness and platform-independent nature enables Java based applications to run on mostly anything. As is the case with any application, we need to store our data in some sort of reliable way – this need called databases to life.

In Java database connections are implemented by JDBC (Java Database Connectivity API), that let’s the programmer handle different kind of databases in almost the same way, which makes our lives much easier when we need to save or read data from a database.

In this tutorial we will create an example Java application that will be able to connect to a PostgreSQL database instance, and write data into it. To check that our data insertion is successful, we’ll also implement reading back and print the table we inserted data into.

In this tutorial you will learn:

  • How to setup the database for the application
  • How to import PostgreSQL JDBC Driver into your project
  • How to insert data into the database
  • How to run a simple query to read a database table’s content
  • How to print fetched data

Read more

nginx-logo

How to setup the Nginx web server on Ubuntu 18.04 Bionic Beaver Linux

Objective

Learn how to install and configure the Nginx web server on Ubuntu 18.04 Bionic Beaver

Requirements

  • Root permissions

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Other Versions of this Tutorial

Ubuntu 20.04 (Focal Fossa)

Introduction

nginx-logo

The Nginx web server, together with Apache, is one of the most known and used web servers in the world. It is generally less resource-hungry than Apache, and can be also used as a reverse-proxy.

In this tutorial we will see how to install and configure the Nginx web server on Ubuntu 18.04 Bionic Beaver.

Read more

Kibana Nginx Configuration On Ubuntu 18.04

Install ELK On Ubuntu 18.04 Bionic Beaver Linux

Objective

Install ELK on Ubuntu 18.04 Bionic Beaver

Distributions

Ubuntu 18.04

Requirements

A working install of Ubuntu 18.04 with root privileges

Conventions

  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Other Versions of this Tutorial

Ubuntu 20.04 (Focal Fossa)

What is ELK

If you’re in a situation where you manage large amonts of data logs, the ELK stack is exactly what you’re looking for. The ELK stack combines Elasticsearch, Logstash, and Kibana into a simple, yet powerful, open source stack that lets you manage large amounts of logged data from a convenient graphical web interface.

All three tools are developed by Elastic, so they work in tandem perfectly, and they’re very easy to get set up on your Ubuntu system.

Read more

install lamp ubuntu 18.04

How To Install LAMP in Ubuntu 18.04 Bionic Beaver (Linux, Apache, MySQL, PHP)

Objective

The objective of this article is LAMP setup. Installing LAMP on Ubuntu 18.04 Bionic Beaver includes the setup of Linux, Apache, MySQL and PHP server, also known as LAMP stack.

Operating System and Software Versions

  • Operating System: – Ubuntu 18.04 Bionic Beaver

Requirements

Privileged access to to your Ubuntu 18.04 system will be required.

Conventions

Read more