• Courses
    [INSERT_ELEMENTOR id="8887"]
  • Features
    • Membership
    • Portfolio
    • About Us
    • FAQs
    • Sidebar Shop
    • 404 Page
  • Events
  • Gallery
  • Blog
  • Contact
  • Shop
    Have any question?
    [email protected]
    Login
    ITIBooks
    • Courses
      [INSERT_ELEMENTOR id="8887"]
    • Features
      • Membership
      • Portfolio
      • About Us
      • FAQs
      • Sidebar Shop
      • 404 Page
    • Events
    • Gallery
    • Blog
    • Contact
    • Shop

      MySQL Database

      • Home
      • Blog
      • MySQL Database
      • How To Install MySQL on CentOS 7

      How To Install MySQL on CentOS 7

      • Categories MySQL Database
      • Date October 10, 2020
      • Comments 0 comment
      • Tags Install MySQL, MySQL Server
      MySQL Server

      MySQL is an open-source database management system, It uses a relational database and SQL (Structured Query Language) to manage its data.

      Download and verify MySQL

      In order to download MySQL, open the following URL in your browser:
      https://dev.mysql.com/downloads/repo/yum/

      mysql version

      Press Download bottom, and at the next page (If you don’t want to create an account) locate the text “No thanks, just start my download” then “Right-click” and choose copy the link location.

      – Download MySQL

      In your CentOS server, run the following command:
      Note: you should edit the link in the following command with your new version.

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

      – Verify the integrity of the downloaded file

      Once the rpm file is saved, we will verify the integrity of the download by running md5sum and comparing it with the corresponding MD5 value listed on the site:

      md5sum mysql80-community-release-el7-3.noarch.rpm
      Output
      893b55d5d885df5c4d4cf7c4f2f6c153  mysql80-community-release-el7-3.noarch.rpm

      Compare this output with the appropriate MD5 value on the site to verify that the file wasn’t corrupted or changed.

      verify MySQL integrity

      Install MySQL Server

      First, we need to install the package:

      rpm -ivh mysql80-community-release-el7-3.noarch.rpm

      This adds two new MySQL yum repositories, and we can now use them to install MySQL server:

      yum install mysql-server

      Press y to confirm that you want to proceed.

      – Starting MySQL Server

      Start MySQL with the following command:

      systemctl start mysqld

      When installing MySQL on CentOS 7, a temporary root password is generated, you can find it using the following command:

      grep 'temporary password' /var/log/mysqld.log

      Make note of the password, which you will need in the next step to secure the installation.

      – Change the temporary password

      1. use this command to run the security script:
      mysql_secure_installation

      2. Enter the temporary password and press Enter.

      3. Now, type in a new strong password.

      4. Follow the on-screen instructions and hit y to finish the setup.

      – Connect to MySQL

      Use the following command to connect to MySQL as root:

      mysql -u root -p

      Enter your MySQL root password and press Enter.

      Connect to MySQL Remotly (Optional)

      1. Create a user and grant it all privileges:

      > CREATE USER 'root'@'%' IDENTIFIED BY 'your-password';
      > GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;

      2. edit my.cnf file:

      make sure that: bind-address=0.0.0.0
      and if you have the line: skip-networking, make sure to comment it.
      Restart MySQL service: systemctl restart mysqld.

      3. Open the firewall port for MySQL:

      MySQL by default use port 3306, you can use the following commands to open it

      > firewall-cmd --add-port=3306/tcp --permanent
      > firewall-cmd --reload

      Now you can successfully connect to your MySQL server remotely.

      Tag:Install MySQL, MySQL Server

      • Share:
      author avatar
      admin

      Previous post

      Install Apache Tomcat on CentOS 7
      October 10, 2020

      Next post

      How to Install and Configure Nginx on CentOS 7
      October 10, 2020

      You may also like

      MySQL-Replication
      How to Setup MySQL Master-Master Replication
      10 December, 2020

      Leave A Reply Cancel reply

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

      Search

      Categories

      • Apache tomcat
      • Backup
      • FTP Server
      • MySQL Database
      • Nginx
      • WildFly
      • Windows
      Introduction LearnPress – LMS plugin

      Introduction LearnPress – LMS plugin

      Free
      From Zero to Hero with Nodejs

      From Zero to Hero with Nodejs

      Free
      Learn Python – Interactive Python

      Learn Python – Interactive Python

      $69.00

      logo-eduma-the-best-lms-wordpress-theme

      (00) 123 456 789

      [email protected]

      Company

      • About Us
      • Blog
      • Contact
      • Become a Teacher

      Links

      • Courses
      • Events
      • Gallery
      • FAQs

      Support

      • Documentation
      • Forums
      • Language Packs
      • Release Status

      Recommend

      • WordPress
      • LearnPress
      • WooCommerce
      • bbPress

      Powered by AxialSystem.

      • Privacy
      • Terms
      • Sitemap
      • Purchase
      [miniorange_social_login shape="longbuttonwithtext" theme="default" space="4" width="240" height="40"]

      Login with your site account

      Lost your password?