Tag: MySQL

MySQL Rejecting Correct Password “Error 1045: Access denied for user (using password: YES)”

If you’re certain the password is correct, it is most likely that MySQL is denying you access based on the specified host value for the user. In this article we will learn how to change a user’s host value in command line or phpMyAdmin.

Introduction This article is for users who are trying to log into MySQL with a correct password but are getting an error: “Error 1045: Access denied for user (using password: YES)” If you’ve forgotten your MySQL root password, please see this article: How to Reset the MySQL root password Understanding MySQL Users and Hosts MySQL…

Continue reading MySQL Rejecting Correct Password “Error 1045: Access denied for user (using password: YES)”

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 / 19.10

In this guide we will install and configure phpMyAdmin to work with Nginx on Ubuntu Server 18.04 / 19.10. phpMyAdmin is open source free software, designed to handle the administration and management of MySQL databases through a graphic user interface.

Prerequisites You should be using a non-root user with sudo privileges as explained in Ubuntu 18.04 / 19.10 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…

Continue reading Installing phpMyAdmin for Nginx on Ubuntu 18.04 / 19.10

Can't connect to MySQL server

Can’t Connect to MySQL Server Remotely on Ubuntu

MySQL by default will not allow incoming remote connections for security reasons. In this article we will edit the MySQL config file mysqld.cnf to allow remote connections.

Testing a Remote MySQL Connection To test a remote MySQL connection in Linux terminal, simply replace username and hostname_or_ip with your own. mysql -u username -h hostname_or_ip -p Or via Command Line 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):…

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 / 19.10

In this guide we will install a LEMP Stack (Nginx, MySQL, PHP) and configure a web server on Ubuntu Server 18.04 / 19.10.

Video Tutorial

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

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

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

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

In this guide we will install a LAMP Stack (Apache, MySQL, PHP) on Ubuntu Server 18.04 / 19.10 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 / 19.10 guide for more details. 1. Install Apache Let’s begin by updating the package lists and installing Apache on Ubuntu 18.04 / 19.10. Below we have two commands separated by &&. The first command will update the package…

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

Installing phpMyAdmin for Apache on Ubuntu 18.04

Installing phpMyAdmin for Apache on Ubuntu 18.04 / 19.10

In this guide we will install and configure phpMyAdmin to work with Apache on Ubuntu Server 18.04 / 19.10.

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 / 19.10. 1. Install phpMyAdmin Let’s begin…

Continue reading Installing phpMyAdmin for Apache on Ubuntu 18.04 / 19.10

Access denied for user ‘root’@’localhost’

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

MySQL 5.7 and above Since October 2015, root now requires sudo privileges in MySQL 5.7+ and phpMyAdmin will not be able to use root credentials. If you are trying to log into phpMyAdmin using an account other than root but you are getting an error “Access denied for user (using password: YES)”, please see this…

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