Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Deploying MySQL 5.7 Using Official Yum Repositories on CentOS

Tech May 17 1

Default repositories in CentOS 7 prioritize MariaDB over MySQL. Executing standard installation commands will result in MariaDB being deployed instead. To utilize the official MySQL packages via the package manager, the specific repository configuration must be added mnaually.

Configure the Official Repository

Retrieve and install the repository RPM package directly from the MySQL dev portal. This step registers the necessary sources without requiring manual file navigation.

rpm -Uvh https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

Install MySQL Server

With the repository enabled, install the community server package.

yum install -y mysql-community-server

Manage the Service

Initialize the daemon and configure it to launch during system boot.

systemctl start mysqld
systemctl enable mysqld

Verify the process is running:

ps aux | grep mysqld

Retrieve Temporary Credentials

Version 5.7 enforces security policies that generate a random root password during initialization. This credential is stored in the log file.

grep -i "temporary password" /var/log/mysqld.log

The output will display a string similar to root@localhost: generated_password. Extract the password portion following the colon.

Secure the Installation

Authenticate using the temporary password:

mysql -u root -p

Once inside the shell, enforce a new compliant password. The policy requires a mix of characters, numbers, and symbols with a minimum length.

ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewSecurePass123!';

Exit the client and reconnect using the new credentials to verify the configuration is complete.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.