How to Install MySQL on CentOS 7

MySQL is a widely-used open-source relational database management system. This article will guide you through installing MySQL on CentOS 7.

Updating System Packages

Update your system’s packages:

sudo yum update -y

Installing MySQL

Install MySQL by first adding the MySQL repository:

sudo rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

Then, install MySQL:

sudo yum install mysql-server -y

Starting and Enabling MySQL

Start the MySQL service:

sudo systemctl start mysqld

Enable it to start on boot:

sudo systemctl enable mysqld

Securing MySQL

Run the security script:

sudo mysql_secure_installation

Follow the prompts to set a root password, remove anonymous users, disallow remote root login, and remove the test database.

Accessing MySQL

Log in to MySQL:

mysql -u root -p

Enter the root password when prompted.

MySQL is now installed and secured on your CentOS 7 server, ready for use in your applications or data management tasks.

About the author

Technical Sahil

Sahil Dhamija is a visionary entrepreneur and tech enthusiast, proudly owning multiple companies across India, the US, the UK, and the UAE. As the founder of AInventions Technologies LLC, DigitalMarkethink Solutions LLC, WebReinvent Technologies LLC, BusinessMate Software Solutions LLC, and co-founder of Hostyaga FZE LLC, Sahil is a dynamic leader shaping the future of technology and digital marketing.

Apart from leading his businesses, Sahil is a passionate tech YouTuber, sharing insights and tutorials on various technological topics. He also serves as the CTO at Vayuna Corporate Travels Pvt Ltd and as Product Head at Vayuna Voicetech Pvt Ltd, where he oversees cutting-edge solutions in corporate travel and voice technology. Additionally, Sahil is a creative force in the film industry, producing films through Gentle Breeze Films Pvt Ltd.

Driven by innovation and creativity, Sahil continues to push boundaries in technology, media, and business.

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *