jueves, 19 de mayo de 2016

Install MySQL 5.7 on Fedora 23/22, CentOS/RHEL

MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. This is guide, howto install or upgrade MySQL Community Server latest version 5.7 (5.7.9) on Fedora 23/22/21, CentOS 7.2/6.7/5.11 and Red Hat (RHEL) 7.2/6.7/5.11. This guide works of course with Oracle Linux and Scientific Linux too and MySQL 5.6/5.5 installation is possible too.
Note: If you are upgrading MySQL (from earlier version), then make sure that you backup (dump and copy) your database and configs. And remember run mysql_upgrade command.

Install MySQL Database 5.7.9 on Fedora 23/22/21, CentOS 7.2/6.7/5.11, Red Hat (RHEL) 7.2/6.7/5.11

1. Change root user

2. Install MySQL YUM repository

Fedora

CentOS and Red Hat (RHEL)

3. Update or Install MySQL 5.7.9

Fedora 23/22

Fedora 21, CentOS 7.2/6.7/5.11 and Red Hat (RHEL) 7.2/6.7/5.11

4. Start MySQL server and autostart MySQL on boot

Fedora 23/22/21 and CentOS 7.2

CentOS 6.7/5.11 and Red Hat (RHEL) 6.7/5.11

5. Get Your Generated Random root Password

Example Output:
And password is: -et)QoL4MLid

6. MySQL Secure Installation

  • Change root password
  • Remove anonymous users
  • Disallow root login remotely
  • Remove test database and access to it
  • Reload privilege tables

Start MySQL Secure Installation with following command

Output:
Note: If you don’t want some reason, do a “MySQL Secure Installation” then at least it’s very important to change the root user’s password

7. Connect to MySQL database (localhost) with password

8. Create Database, Create MySQL User and Enable Remote Connections to MySQL Database

This example uses following parameters:
  • DB_NAME = webdb
  • USER_NAME = webdb_user
  • REMOTE_IP = 10.0.15.25
  • PASSWORD = password123
  • PERMISSIONS = ALL

Enable Remote Connection to MariaDB Server –> Open MySQL Port (3306) on Iptables Firewall (as root user again)

1. Fedora 23/22/21 and CentOS/Red Hat (RHEL) 7.2

1.1 Add New Rule to Firewalld

1.2 Restart firewalld.service

2. CentOS/Red Hat (RHEL) 6.7/5.11

2.1 Edit /etc/sysconfig/iptables file:

2.2 Add following INPUT rule:

2.3 Restart Iptables Firewall:

3. Test remote connection

0 comentarios:

Publicar un comentario