Tag: MySQL

How to Back Up MySQL Databases with Linux Command Line

How to Back Up MySQL Databases with Linux Command Line and Automate with Cron

It’s important to make frequent automated backups of your MySQL databases should you ever accidentally alter data or suffer a hack. In this guide we will learn how to use mysqldump to export databases and use crontab to automate the entire process.

1. Prepare MySQL Backup Folder There is no particular recommended folder to back up to in Linux so you can choose this yourself. In this guide, we are saving backups to /var/mysql_backups/. Ideally you would store these on an external drive or an offsite server, but in this guide we will focus on creating backups locally.…

Continue reading How to Back Up MySQL Databases with Linux Command Line and Automate with Cron

How to Reset MySQL Root Password in Ubuntu

How to Reset the MySQL Root Password on Ubuntu

In this article we will reset the MySQL root password in Ubuntu by starting MySQL with the --skip-grant-tables option.

1. Confirm MySQL version Firstly, you must confirm which version of MySQL on Ubuntu you are running as commands will be different. mysql -V mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using EditLine wrapper Keep note of your “Distrib”. In the above example, we are on MySQL 5.7. Keep note of this for later. 2. Restart…

Continue reading How to Reset the MySQL Root Password on Ubuntu

Installing phpMyAdmin for Nginx on Ubuntu 18.04

Installing phpMyAdmin for Nginx on Ubuntu 18.04

In this guide we will install and configure phpMyAdmin to work with Nginx on Ubuntu Server 18.04 LTS (Bionic Beaver). phpMyAdmin is open source free software, designed to handle the administration and management of MySQL databases through a graphic user interface. Written in PHP, PHPMyAdmin has become one of the most popular web-based MySQL management tools.

Prerequisites You should be using a non-root user with sudo privileges as explained in Ubuntu 18.04 Initial Server Setup. You should also have your LEMP stack (Nginx, MySQL and PHP) already installed before continuing with this guide. If you don’t have these installed yet, please see Installing a LEMP Stack (Nginx, MySQL, PHP) on Ubuntu 18.04. 1.…

Continue reading Installing phpMyAdmin for Nginx on Ubuntu 18.04

Can't connect to MySQL server

Can’t connect to MySQL server remotely on Ubuntu

To test a remote MySQL connection in Linux terminal: mysql -u username -h 192.16.8.1.22 -p Or via Telnet in WIndows: telnet 192.16.8.1.22 3306 If you are getting an error when trying to connect to your remote MySQL server ERROR 2003 (HY000): Can’t connect to MySQL server on ‘192.16.8.1.22’ (111) or in Telnet Connecting To 192.16.8.1.22…Could not open connection…

Continue reading Can’t connect to MySQL server remotely on Ubuntu

Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04

Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04

Ubuntu Server 18.04 LTS (Bionic Beaver) is finally here and is being rolled out across VPS hosts such as DigitalOcean and AWS. In this guide we will install a LEMP Stack (Nginx, MySQL, PHP) and configure a web server.

Video Tutorial

Prerequisites You should use a non-root user account with sudo privileges. Please see the Initial server setup for Ubuntu 18.04 guide for more details. 1. Install Nginx Let’s begin by updating the package lists and installing Nginx on Ubuntu 18.04. Below we have two commands separated by &&. The first command will update the package lists to ensure you…

Continue reading Installing Nginx, MySQL, PHP (LEMP) Stack on Ubuntu 18.04

Installing Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04

Installing Apache, MySQL, PHP (LAMP) Stack on Ubuntu 18.04

Ubuntu Server 18.04 LTS (Bionic Beaver) is finally here and is being rolled out across VPS hosts such as DigitalOcean and AWS. In this guide we will install a LAMP Stack (Apache, MySQL, PHP) and configure a web server.

Video Tutorial

Prerequisites You should use a non-root user account with sudo privileges. Please see the Initial server setup for Ubuntu 18.04 guide for more details. 1. Install Apache Let’s begin by updating the package lists and installing Apache on Ubuntu 18.04. Below we have two commands separated by &&. The first command will update the package lists to ensure you get…

Continue reading Installing Apache, MySQL, PHP (LAMP) Stack on Ubuntu 18.04

Installing phpMyAdmin for Apache on Ubuntu 18.04

Installing phpMyAdmin for Apache on Ubuntu 18.04

In this guide we will install and configure phpMyAdmin to work with Apache on Ubuntu Server 18.04 LTS (Bionic Beaver).  phpMyAdmin is open source free software, designed to handle the administration and management of MySQL databases through a graphic user interface. Written in PHP, PHPMyAdmin has become one of the most popular web-based MySQL management tools.

Video Tutorial

Prerequisites You should be using a non-root user with sudo privileges as explained in Ubuntu 18.04 Initial Server Setup. You should also have your LAMP stack already installed and serving web pages before continuing with this guide. Please see Installing a LAMP Stack (Apache, MySQL, PHP) on Ubuntu 18.04. 1. Install phpMyAdmin Let’s begin by updating…

Continue reading Installing phpMyAdmin for Apache on Ubuntu 18.04

Access denied for user ‘root’@’localhost’

Can’t log into phpMyAdmin: mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’localhost’

You’ve installed phpMyAdmin but cannot log in using the root account. mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’localhost’ In MySQL 5.7 and above, root login requires sudo privileges and phpMyAdmin will not be able to use root credentials. It’s also not recommended that you allow the root account to be accessible remotely via phpMyAdmin as bots and…

Continue reading Can’t log into phpMyAdmin: mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’localhost’

Installing MySQL on Ubuntu 18.04

Installing MySQL Server on Ubuntu 18.04

In this guide we will install and configure MySQL on Ubuntu Server 18.04 (Bionic Beaver). MySQL is the world’s most popular open source database, enabling the cost-effective delivery of reliable, high-performance and scalable Web-based database applications.

Video Tutorial

Prerequisites You should use a non-root user account as explained in the Ubuntu 18.04 Initial Server Setup. 1. Install MySQL Let’s begin by updating the package lists and installing MySQL on Ubuntu 18.04. Below we have two commands separated by &&. The first command will update the package lists to ensure you get the latest version and…

Continue reading Installing MySQL Server on Ubuntu 18.04

Guide: Installing phpMyAdmin for Apache on Ubuntu 16.04 / 17.10

In this guide we will install and configure phpMyAdmin to work with Apache on Ubuntu 16.04 / 17.10. Prerequisites You should be using a non-root user with sudo privileges as explained in Ubuntu 16.04 / 17.10 Initial Server Setup. You should also have your LAMP stack (Apache, MySQL and PHP) already installed before continuing with…

Continue reading Guide: Installing phpMyAdmin for Apache on Ubuntu 16.04 / 17.10