INSTALL MYSQL ON CentOS7

 


Sure! Here's the guide in a format suitable for posting on Google Blogger:


**How to Install MySQL on Linux using Yum Repository**


MySQL is a popular open-source relational database management system. In this guide, we'll walk you through the steps to install MySQL on Linux using the Yum repository.


**Step 1: Add MySQL Yum Repository**

1. Go to the [Download MySQL Yum Repository](https://dev.mysql.com/downloads/repo/yum/) page in the MySQL Developer Zone.

2. Select and download the release package for your platform.

3. Install the downloaded release package (replace "platform-and-version-specific-package-name" with the actual name):

   ```

   sudo yum localinstall platform-and-version-specific-package-name.rpm

   ```

   

**Step 2: Verify MySQL Yum Repository**

To ensure the MySQL Yum repository is enabled and added successfully, run the following command:

```

yum repolist enabled | grep "mysql.*-community.*"

```


**Step 3: Selecting a Release Series**

By default, the latest GA series (currently MySQL 5.7) will be selected for installation. If you want a different series, follow these steps:

1. To see all available subrepositories for different release series:

   ```

   yum repolist all | grep mysql

   ```

2. To install a different series (e.g., MySQL 5.6), disable the subrepository for the latest GA series and enable the one for the specific series. For example:

   ```

   sudo yum-config-manager --disable mysql57-community

   sudo yum-config-manager --enable mysql56-community

   ```

3. Verify the enabled and disabled subrepositories:

   ```

   yum repolist enabled | grep mysql

   ```


**Step 4: Disabling the Default MySQL Module**

If the default MySQL module is enabled, disable it with the following command:

```

sudo yum module disable mysql

```


**Step 5: Installing MySQL**

Install MySQL server and related components with this command:

```

sudo yum install mysql-community-server

```

This will install the MySQL server package (mysql-community-server) along with other required components.


**Step 6: Starting the MySQL Server**

Start the MySQL server with the following command:

```

sudo service mysqld start

```

You should see the message "Starting mysqld:[ OK ]" indicating that the MySQL server has started successfully.


Now you have MySQL installed and running on your Linux system. You can use it to manage databases and build powerful applications!


Remember to follow security best practices and configure MySQL according to your needs. Happy blogging!