How to install MySQL database on Linux?
To install the MySQL database on Linux, you can proceed with the following steps:
- Open the terminal and log into the system as root or a user with administrative privileges.
- Update package list.
- Update using apt command with elevated privileges.
- Install MySQL server.
- Please install mysql-server using sudo apt.
- During the installation process, you will be prompted to set the root user password. Input and confirm the password.
- After installation is complete, run the MySQL security script to configure database security settings.
- Please run the mysql_secure_installation command with sudo.
- Customize the settings according to your own needs based on the prompts.
- Start the MySQL service.
- Initiate the mysql service.
- Check if the MySQL service has been started.
- Display the status of MySQL by using the command “sudo systemctl status mysql”.
- If “active (running)” is displayed, it means that the MySQL service has been successfully started.
- Option: Set MySQL server to automatically start on boot.
- Activate the mysql service using systemctl command.
At this point, MySQL database has been successfully installed on the Linux system. You can use the MySQL client to connect to the database and manage and operate it.