Enter and then confirm a secure password of your choice.įrom there, you can press Y and then ENTER to accept the defaults for all the subsequent questions. Regardless of your choice, the next prompt will be to set a password for the MySQL root user. The first prompt will ask whether you’d like to set up the Validate Password Plugin, which can be used to test the strength of your MySQL password. This will take you through a series of prompts where you can make some changes to your MySQL installation’s security options. On older versions of MySQL, you needed to initialize the data directory manually as well, but this is done automatically now. This changes some of the less secure default options for things like remote root logins and sample users. Step 2 - Configuring MySQLįor fresh installations, you’ll want to run the included security script. Because this leaves your installation of MySQL insecure, we will address this next.
This will install MySQL, but will not prompt you to set a password or make any other configuration changes. To install it, update the package index on your server with apt:
On Ubuntu 18.04, only the latest version of MySQL is included in the APT package repository by default.
This tutorial will explain how to install MySQL version 5.7 on an Ubuntu 18.04 server. The short version of the installation is simple: update your package index, install the mysql-server package, and then run the included security script. It uses a relational database and SQL (Structured Query Language) to manage its data. MySQL is an open-source database management system, commonly installed as part of the popular LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack. A previous version of this tutorial was written by Hazel Virdó Introduction