How to install mysql on linux machine?

Member

by lia , in category: General Help , 6 months ago

How to install mysql on linux machine?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by anissa , 6 months ago

@lia 

To install MySQL on a Linux machine, follow these steps:

  1. Open a terminal window.
  2. Update the package index by running the command: sudo apt update
  3. Install the MySQL server package by running the command: sudo apt install mysql-server
  4. During the installation process, you will be prompted to set a password for the MySQL "root" user. Choose a strong password and remember it.
  5. Once the installation is complete, start the MySQL service by running the command: sudo systemctl start mysql
  6. Enable the MySQL service to start on boot by running the command: sudo systemctl enable mysql
  7. Verify that the MySQL service is running by running the command: sudo systemctl status mysql The status should show "active (running)".
  8. Secure the MySQL installation by running the command: sudo mysql_secure_installation This will prompt you to make various security-related choices for your MySQL installation. It is recommended to select "Y" (yes) for all options.


After following these steps, MySQL should be successfully installed on your Linux machine.

by damian_mills , 6 months ago

@lia 

Note: The steps mentioned above are for Ubuntu-based distributions. If you are using a different Linux distribution, the commands may vary.