Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install MySQL.  SIdora is tested with MySQL 5.6.31.  Versions later than 5.1 should work but for production the latest Version 5.x is recommended.  Other databases can be used notably PostgreSQL.  MySQL is no longer being distributed with RHEL 7 so you will have to install from downloaded packages:

    Code Block
    languagebash
    rpm -ivh MySQL-server-5.6.2431-1.el6.x86_64.rpm
    rpm -ivh MySQL-client-5.6.2431-1.el6.x86_64.rpm
  2. Start MySQL:

    Code Block
    languagebash
    chkconfig mysql on # Automatically start mysqld on boot
    service mysql start # Start mysqld for configuration
  3. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root user! You likely will need to get the random password in /root/.mysql_secret first.  Start the server, then issue the following commands:

    Code Block
    languagebash
    /usr/bin/mysqladmin -u root password '<root-secret>'
    /usr/bin/mysqladmin -u root -h localhost.localdomain password '<root-secret>'
  4. Alternatively you can run /usr/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is recommended for production servers. See the MySql manual for more instructions.
  5. Create Database, Users and Privileges. We will create the databases needed for Fedora in the following operations. We will also create the users and permissions needed for Fedora.

    Code Block
    languagesql
    [user@server] mysql -u root -p
    mysql> CREATE DATABASE fedora3;
    mysql> GRANT ALL ON fedora3.* TO '<fedoradbuser>'@localhost IDENTIFIED BY '<secret>';
    mysql> FLUSH PRIVILEGES;
    mysql> EXIT;
  6. If any services access the database remotely, permission for the client must be added to the database.  Likely you should be more restrictive in production granting access to only a limited set of IP addresses:

    Code Block
    languagebash
    [user@server] mysql -u root -p
    mysql> GRANT ALL PRIVILEGES ON fedora3.* TO '<fedoradbuser>'@'%' IDENTIFIED BY '<secret>';
    mysql> FLUSH PRIVILEGES;
    mysql> EXIT;

...