How to install mysql in ubuntu server?

by bobbie.kris , in category: Installation & Upgrades , a year ago

How to install mysql in ubuntu server?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by viola_gleichner , 9 months ago


To install MySQL on an Ubuntu server, follow these steps:

  1. Update the package index: sudo apt update
  2. Install the MySQL server package: sudo apt install mysql-server
  3. During the installation process, you will be prompted to set a password for the root user. Make sure to choose a strong password and remember it, as you will need it later to manage your MySQL server.
  4. Once the installation is complete, run the following command to check the status of the MySQL service: sudo systemctl status mysql
  5. If the MySQL service is not running, start it using the following command: sudo systemctl start mysql
  6. To ensure that the MySQL service starts automatically at boot time, run the following command: sudo systemctl enable mysql
  7. To log in to the MySQL server as the root user, run the following command: mysql -u root -p
  8. You will be prompted to enter the password you set during the installation process. Once you have entered the correct password, you will be logged in to the MySQL server.

That's it! You have now successfully installed MySQL on your Ubuntu server.