-
Notifications
You must be signed in to change notification settings - Fork 7
Installation: sql db for Fedora
The Fedora database stores information about the content in Fedora. A SQL database must be installed prior to installing Fedora.
These instructions reflect the use of the MySQL database.
-
Install MySQL Server Version 5.6 by entering the commands below.
Ubuntu:sudo apt-get install mysql-server
CentOS:cd /opt/install wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm sudo rpm -ivh mysql-community-release-el6-5.noarch.rpm sudo yum install mysql-server cd /opt
-
Type
Y
when asked "Is this ok [y/N]". Note: You will need to do this three times during the installation. -
Confirm that you installed MySQL-server version 5.6 - the version is listed in the download/install output which should look similar to the text below (with the ... indicating system generated code that has been intentionally left out of these instructions):
...
sudo rpm -ivh mysql-community-release-el6-5.noarch.rpm
mysql-community-common x86_64 5.6.15-1.el6 mysql56-community 296 k
mysql-community-libs-compat x86_64 5.6.15-1.el6 mysql56-community 1.6 MTransaction Summary
================================================================================
Install 7 Package(s)Total download size: 76 M
Is this ok [y/N]: Y
Is this ok [y/N]: Y
Downloading Packages:
Setting up and reading Presto delta metadata
...
Userid : MySQL Release Engineering [email protected]
Package: mysql-community-release-el6-5.noarch (installed)
From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: Y
Running rpm_check_debug
Running Transaction Test
...
Installed:
mysql-community-client.x86_64 0:5.6.15-1.el6
mysql-community-devel.x86_64 0:5.6.15-1.el6
mysql-community-libs.x86_64 0:5.6.15-1.el6
mysql-community-server.x86_64 0:5.6.15-1.el6Dependency Installed:
libaio.x86_64 0:0.3.107-10.el6
mysql-community-common.x86_64 0:5.6.15-1.el6
mysql-community-libs-compat.x86_64 0:5.6.15-1.el6Replaced:
mysql.x86_64 0:5.1.71-1.el6 mysql-devel.x86_64 0:5.1.71-1.el6
mysql-libs.x86_64 0:5.1.71-1.el6Complete!
-
Secure the MySQL-server and set the root password, using the commands below.
Ubuntu: The installer will prompt you to set a root password.
CentOS:- Start MySQL by entering the command
sudo service mysqld start
in the terminal window. - Enter the command
/usr/bin/mysql_secure_installation
. - Follow the prompts to set the password and secure the database.
- Start MySQL by entering the command
-
(CentOS only) Set MySQL to run automatically on startup/reboot by entering the command
sudo chkconfig mysqld on
in the terminal window. -
Move MySQL and configure the data directory by entering the following commands in the terminal window.
sudo service mysqld stop sudo cp -a /var/lib/mysql/ /opt/ sudo mkdir /etc/mysql sudo mv /etc/my.cnf /etc/mysql/
-
(Ubuntu only) If you are using apparmor, edit /etc/apparmor.d/local/usr.sbin.mysqld to add the lines that allow the /opt/mysql directory.
/opt/mysql/ r, /opt/mysql/** rwk,
-
Edit /etc/mysql/my.cnf, located in the [mysqld] section, as follows: 1. Change the data directory line to read:
datadir=/opt/mysql
1. Set character set to utf8
character_set_server=utf8
-
Confirm permissions for MySQL directory and contents, by entering the command
sudo chown -R mysql:mysql /opt/mysql
. -
Restart MySQL by entering the command
sudo service mysqld start
.
CentOS NOTE: if you have trouble restarting MySQL, please confirm that you have disabled SELinux -
Create the MySQL databases for Fedora.
- Log in to MySQL by entering the command
mysql -u root -p
. - Enter the MySQL root password, which you set when you configured MySQL-server in Step 4 above.
- Create the database using the commands below.
CREATE DATABASE fedora3; GRANT ALL ON fedora3.* TO fedoraDBAdmin@localhost IDENTIFIED BY 'fedoraAdmin'; GRANT ALL ON fedora3.* TO fedoraDBAdmin@'%' IDENTIFIED BY 'fedoraAdmin'; exit
The final output should look like this:
mysql> CREATE DATABASE fedora3;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL ON fedora3. TO fedoraDBAdmin@localhost IDENTIFIED BY 'fedoraAdmin';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON fedora3. TO fedoraDBAdmin@'%' IDENTIFIED BY 'fedoraAdmin';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye - Log in to MySQL by entering the command
-
Log in to MySQL by entering the command
mysql -u root -p
in the terminal window. -
Show the character sets by entering the command
SHOW VARIABLES LIKE 'char%';
.
The output should look like this:+--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+
-
Check the storage engine by entering the command
SHOW VARIABLES LIKE 'default%';
in the terminal window.
The output should look like this.+----------------------------+--------+ | Variable_name | Value | +----------------------------+--------+ | default_storage_engine | InnoDB | | default_tmp_storage_engine | InnoDB | | default_week_format | 0 | +----------------------------+--------+
Proceed to Install Fedora or return to the Overview page.