How to Install MySQL Database on a Linux Server

1. Login using Putty: https://clients.activeservers.in/knowledgebase/257/How-to-Connect-to-a-Linux-Server-Using-PuTTY-Step-by-Step-Guide.html

2. Update the System:

Before installing MySQL, ensure your system is updated: sudo yum update –y 

3.Install MySQL Server: 

  • Install MySQL: sudo yum install mysql-server –y 
  • Start and enable MySQL service: sudo systemctl start mysqld 

         sudo systemctl enable mysqld 

  • Check MySQL Status: sudo systemctl status mysqld 

 

4. Secure MySQL Installation

  • After installation, it is recommended to run the MySQL security script to set root password and apply basic security settings. 

         sudo mysql_secure_installation 

  • You will be asked to: 
  • Set the root password 
  • Remove anonymous users 
  • Disallow remote root login 
  • Remove test database 
  • Reload privilege tables 

 5. Log in to MySQL:

  • Once installed, you can log in to the MySQL shell using: sudo mysql -u root –p 

6.Create a Database and User:

  • To create a new database and user: 

CREATE DATABASE mydatabase; 

CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; 

GRANT ALL PRIVILEGES ON mydatabase.* TO 'myuser'@'localhost'; 

FLUSH PRIVILEGES; 

  • linux, database, mysql
  • 0 משתמשים שמצאו מאמר זה מועיל
?האם התשובה שקיבלתם הייתה מועילה

מאמרים קשורים

Backup restoration

Since backups are saved at various nodes to avoid data loss, we manage the backup and...

How To allow SQL Express traffic in windows firewall

Please follow the below steps to allow SQL express communication in the firewall. Open SQL...

How to change SQL authentication in SQL Express

Please follow the below steps Login to SQL Express using SQL management studio. Right-click...

Set Up Sending of Email in Plesk

To Set Up Sending of Email in Plesk, You need to follow the below Points   1. Go to Tools...

How to check Port status of VPS

It may possible that the firewall has blocked a few ports and it is not accessible.  To check...