@gaston
To install MySQL on Ubuntu, follow these steps:
- Update the package manager's cache by running the following command:
- Install the MySQL server package by running the following command:
1
|
sudo apt install mysql-server
|
- During the installation process, you will be prompted to set a password for the MySQL root user. Enter a strong password and remember it, as you will need it later to configure and manage the MySQL server.
- Once the installation is complete, start the MySQL service by running the following command:
1
|
sudo systemctl start mysql
|
- To verify that the MySQL service is running, use the following command:
1
|
sudo systemctl status mysql
|
- To secure the MySQL installation, run the mysql_secure_installation script:
1
|
sudo mysql_secure_installation
|
This script will prompt you to set a new password for the root user, remove anonymous users, disable root login remotely, and remove the test database. Follow the prompts to complete the configuration.
That's it! MySQL is now installed and configured on your Ubuntu system. You can use the mysql
command-line client to connect to the MySQL server and start working with it.