Howto install and configure MySQL server on Fedora 17

Howto install and configure MySQL server on Fedora 17

1. Install MySQL by yum install:

[root@fedora17 ~]#yum -y install mysql-server

………………………………………………………………………………………………

(20/56): perl-EV-4.03-8.fc17.i686.rpm | 251 kB 00:00
(21/56): perl-Encode-Locale-1.02-5.fc17.noarch.rpm | 15 kB 00:00
(22/56): perl-Event-1.20-1.fc17.i686.rpm | 280 kB 00:00
(23/56): perl-Event-Lib-1.03-16.fc17.i686.rpm | 50 kB 00:00
(24/56): perl-Glib-1.241-2.fc17.i686.rpm | 348 kB 00:00
(25/56): perl-Guard-1.022-1.fc17.i686.rpm | 18 kB 00:00
(26/56): perl-HTML-Parser-3.69-3.fc17.i686.rpm | 111 kB 00:00
(27/56): perl-HTML-Tagset-3.20-10.fc17.noarch.rpm | 17 kB 00:00
(28/56): perl-HTTP-Date-6.00-3.fc17.noarch.rpm | 13 kB 00:00
(29/56): perl-HTTP-Message-6.03-1.fc17.noarch.rpm | 78 kB 00:00
(30/56): perl-Heap-0.80-10.fc17.noarch.rpm | 46 kB 00:00
(31/56): perl-IO-AIO-4.15-1.fc17.i686.rpm | 112 kB 00:00
(32/56): perl-IO-Async-0.29-7.fc17.noarch.rpm | 160 kB 00:00
(33/56): perl-IO-Compress-2.052-1.fc17.noarch.rpm | 251 kB 00:00
(34/56): perl-IO-Socket-SSL-1.66-1.fc17.noarch.rpm | 81 kB 00:00
(35/56): perl-IO-Tty-1.10-8.fc17.i686.rpm | 39 kB 00:00
(36/56): perl-LWP-MediaTypes-6.01-4.fc17.noarch.rpm | 20 kB 00:00
(37/56): perl-Module-Pluggable-3.90-218.fc17.noarch.rpm | 48 kB 00:00
(38/56): perl-Net-HTTP-6.02-2.fc17.noarch.rpm | 27 kB 00:00
(39/56): perl-Net-LibIDN-0.12-8.fc17.i686.rpm | 27 kB 00:00
(40/56): perl-Net-SSLeay-1.48-1.fc17.i686.rpm | 268 kB 00:01
(41/56): perl-POE-1.350-2.fc17.noarch.rpm | 583 kB 00:01
(42/56): perl-PathTools-3.33-218.fc17.i686.rpm | 106 kB 00:00
(43/56): perl-Pod-Escapes-1.04-218.fc17.noarch.rpm | 41 kB 00:00
(44/56): perl-Pod-Simple-3.16-218.fc17.noarch.rpm | 223 kB 00:00
(45/56): perl-Scalar-List-Utils-1.25-1.fc17.i686.rpm | 34 kB 00:00
(46/56): perl-Socket-2.001-1.fc17.i686.rpm | 44 kB 00:00
(47/56): perl-Socket-GetAddrInfo-0.19-1.fc17.i686.rpm | 32 kB 00:00
(48/56): perl-Socket6-0.23-8.fc17.i686.rpm | 22 kB 00:00
(49/56): perl-TermReadKey-2.30-14.fc17.i686.rpm | 29 kB 00:00
(50/56): perl-TimeDate-1.20-6.fc17.noarch.rpm | 43 kB 00:00
(51/56): perl-URI-1.60-1.fc17.noarch.rpm | 104 kB 00:00
(52/56): perl-common-sense-3.5-1.fc17.noarch.rpm | 26 kB 00:00
(53/56): perl-libs-5.14.3-218.fc17.i686.rpm | 637 kB 00:01
(54/56): perl-macros-5.14.3-218.fc17.i686.rpm | 33 kB 00:00
(55/56): perl-threads-1.86-2.fc17.i686.rpm | 47 kB 00:00
(56/56): perl-threads-shared-1.40-2.fc17.i686.rpm | 36 kB 00:00
——————————————————————————–
Total 364 kB/s | 30 MB 01:23
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-i386
Importing GPG key 0x1ACA3465:
Userid : “Fedora (17) <fedora@fedoraproject.org>”
Fingerprint: cac4 3fb7 74a4 a673 d81c 5de7 50e9 4c99 1aca 3465
Package : fedora-release-17-1.noarch (@anaconda-0)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-i386
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:perl-Pod-Escapes-1.04-218.fc17.noarch 1/56
Installing : 4:perl-libs-5.14.3-218.fc17.i686 2/56
Installing : perl-PathTools-3.33-218.fc17.i686 3/56
Installing : perl-threads-1.86-2.fc17.i686 4/56
Installing : perl-Scalar-List-Utils-1.25-1.fc17.i686 5/56
Installing : perl-threads-shared-1.40-2.fc17.i686 6/56
Installing : 1:perl-Module-Pluggable-3.90-218.fc17.noarch 7/56
Installing : perl-Carp-1.22-2.fc17.noarch 8/56
Installing : perl-Socket-2.001-1.fc17.i686 9/56
Installing : 4:perl-macros-5.14.3-218.fc17.i686 10/56
Installing : 1:perl-Pod-Simple-3.16-218.fc17.noarch 11/56
Installing : 4:perl-5.14.3-218.fc17.i686 12/56
Installing : perl-common-sense-3.5-1.fc17.noarch 13/56
Installing : perl-URI-1.60-1.fc17.noarch 14/56
Installing : perl-Compress-Raw-Zlib-2.052-1.fc17.i686 15/56
Installing : mysql-libs-5.5.28-2.fc17.i686 16/56
Installing : perl-Heap-0.80-10.fc17.noarch 17/56
Installing : perl-Encode-Locale-1.02-5.fc17.noarch 18/56
Installing : perl-IO-Tty-1.10-8.fc17.i686 19/56
Installing : 1:perl-TimeDate-1.20-6.fc17.noarch 20/56
Installing : perl-HTTP-Date-6.00-3.fc17.noarch 21/56
Installing : perl-HTML-Tagset-3.20-10.fc17.noarch 22/56
Installing : perl-Async-MergePoint-0.03-7.fc17.noarch 23/56
Installing : mailcap-2.1.39-1.fc17.noarch 24/56
Installing : perl-BDB-1.88-5.fc17.i686 25/56
Installing : perl-IO-AIO-4.15-1.fc17.i686 26/56
Installing : perl-Net-SSLeay-1.48-1.fc17.i686 27/56
Installing : perl-Event-1.20-1.fc17.i686 28/56
Installing : perl-LWP-MediaTypes-6.01-4.fc17.noarch 29/56
Installing : mysql-5.5.28-2.fc17.i686 30/56
Installing : perl-EV-4.03-8.fc17.i686 31/56
Installing : perl-TermReadKey-2.30-14.fc17.i686 32/56
Installing : perl-Compress-Raw-Bzip2-2.052-1.fc17.i686 33/56
Installing : perl-IO-Compress-2.052-1.fc17.noarch 34/56
Installing : perl-HTML-Parser-3.69-3.fc17.i686 35/56
Installing : perl-HTTP-Message-6.03-1.fc17.noarch 36/56
Installing : perl-Guard-1.022-1.fc17.i686 37/56
Installing : perl-Glib-1.241-2.fc17.i686 38/56
Installing : perl-Curses-1.28-5.fc17.i686 39/56
Installing : perl-Net-LibIDN-0.12-8.fc17.i686 40/56
Installing : perl-IO-Socket-SSL-1.66-1.fc17.noarch 41/56
Installing : perl-Net-HTTP-6.02-2.fc17.noarch 42/56
Installing : perl-Socket6-0.23-8.fc17.i686 43/56
Installing : perl-POE-1.350-2.fc17.noarch 44/56
Installing : perl-Socket-GetAddrInfo-0.19-1.fc17.i686 45/56
Installing : perl-IO-Async-0.29-7.fc17.noarch 46/56
Installing : libevent-2.0.18-1.fc17.i686 47/56
Installing : perl-Event-Lib-1.03-16.fc17.i686 48/56
Installing : perl-AnyEvent-5.27-7.fc17.noarch 49/56
Installing : perl-AnyEvent-AIO-1.1-8.fc17.noarch 50/56
Installing : perl-AnyEvent-BDB-1.1-7.fc17.noarch 51/56
Installing : perl-Coro-6.07-3.fc17.i686 52/56
Installing : perl-DBI-1.617-1.fc17.i686 53/56
Installing : perl-DBD-MySQL-4.020-2.fc17.i686 54/56
Installing : libaio-0.3.109-5.fc17.i686 55/56
Installing : mysql-server-5.5.28-2.fc17.i686 56/56
Verifying : perl-HTTP-Message-6.03-1.fc17.noarch 1/56
Verifying : perl-HTTP-Date-6.00-3.fc17.noarch 2/56
Verifying : perl-Event-Lib-1.03-16.fc17.i686 3/56
Verifying : 4:perl-5.14.3-218.fc17.i686 4/56
Verifying : 4:perl-libs-5.14.3-218.fc17.i686 5/56
Verifying : perl-TermReadKey-2.30-14.fc17.i686 6/56
Verifying : perl-threads-shared-1.40-2.fc17.i686 7/56
Verifying : perl-DBI-1.617-1.fc17.i686 8/56
Verifying : libaio-0.3.109-5.fc17.i686 9/56
Verifying : mysql-server-5.5.28-2.fc17.i686 10/56
Verifying : mysql-libs-5.5.28-2.fc17.i686 11/56
Verifying : perl-Compress-Raw-Zlib-2.052-1.fc17.i686 12/56
Verifying : perl-IO-Async-0.29-7.fc17.noarch 13/56
Verifying : perl-POE-1.350-2.fc17.noarch 14/56
Verifying : perl-PathTools-3.33-218.fc17.i686 15/56
Verifying : perl-IO-Compress-2.052-1.fc17.noarch 16/56
Verifying : perl-LWP-MediaTypes-6.01-4.fc17.noarch 17/56
Verifying : 1:perl-Module-Pluggable-3.90-218.fc17.noarch 18/56
Verifying : perl-threads-1.86-2.fc17.i686 19/56
Verifying : perl-common-sense-3.5-1.fc17.noarch 20/56
Verifying : perl-HTML-Parser-3.69-3.fc17.i686 21/56
Verifying : perl-Heap-0.80-10.fc17.noarch 22/56
Verifying : perl-BDB-1.88-5.fc17.i686 23/56
Verifying : perl-Coro-6.07-3.fc17.i686 24/56
Verifying : perl-IO-Socket-SSL-1.66-1.fc17.noarch 25/56
Verifying : perl-Scalar-List-Utils-1.25-1.fc17.i686 26/56
Verifying : perl-Encode-Locale-1.02-5.fc17.noarch 27/56
Verifying : perl-AnyEvent-AIO-1.1-8.fc17.noarch 28/56
Verifying : perl-Compress-Raw-Bzip2-2.052-1.fc17.i686 29/56
Verifying : perl-Guard-1.022-1.fc17.i686 30/56
Verifying : perl-Carp-1.22-2.fc17.noarch 31/56
Verifying : perl-URI-1.60-1.fc17.noarch 32/56
Verifying : perl-Net-SSLeay-1.48-1.fc17.i686 33/56
Verifying : perl-Glib-1.241-2.fc17.i686 34/56
Verifying : perl-Curses-1.28-5.fc17.i686 35/56
Verifying : perl-IO-Tty-1.10-8.fc17.i686 36/56
Verifying : perl-EV-4.03-8.fc17.i686 37/56
Verifying : 1:perl-TimeDate-1.20-6.fc17.noarch 38/56
Verifying : perl-Socket-2.001-1.fc17.i686 39/56
Verifying : libevent-2.0.18-1.fc17.i686 40/56
Verifying : 4:perl-macros-5.14.3-218.fc17.i686 41/56
Verifying : perl-Net-LibIDN-0.12-8.fc17.i686 42/56
Verifying : perl-Socket6-0.23-8.fc17.i686 43/56
Verifying : 1:perl-Pod-Simple-3.16-218.fc17.noarch 44/56
Verifying : perl-DBD-MySQL-4.020-2.fc17.i686 45/56
Verifying : perl-HTML-Tagset-3.20-10.fc17.noarch 46/56
Verifying : perl-Net-HTTP-6.02-2.fc17.noarch 47/56
Verifying : perl-Event-1.20-1.fc17.i686 48/56
Verifying : perl-AnyEvent-5.27-7.fc17.noarch 49/56
Verifying : perl-IO-AIO-4.15-1.fc17.i686 50/56
Verifying : perl-Async-MergePoint-0.03-7.fc17.noarch 51/56
Verifying : mailcap-2.1.39-1.fc17.noarch 52/56
Verifying : perl-Socket-GetAddrInfo-0.19-1.fc17.i686 53/56
Verifying : mysql-5.5.28-2.fc17.i686 54/56
Verifying : perl-AnyEvent-BDB-1.1-7.fc17.noarch 55/56
Verifying : 1:perl-Pod-Escapes-1.04-218.fc17.noarch 56/56

Installed:
mysql-server.i686 0:5.5.28-2.fc17

Dependency Installed:
libaio.i686 0:0.3.109-5.fc17
libevent.i686 0:2.0.18-1.fc17
mailcap.noarch 0:2.1.39-1.fc17
mysql.i686 0:5.5.28-2.fc17
mysql-libs.i686 0:5.5.28-2.fc17
perl.i686 4:5.14.3-218.fc17
perl-AnyEvent.noarch 0:5.27-7.fc17
perl-AnyEvent-AIO.noarch 0:1.1-8.fc17
perl-AnyEvent-BDB.noarch 0:1.1-7.fc17
perl-Async-MergePoint.noarch 0:0.03-7.fc17
perl-BDB.i686 0:1.88-5.fc17
perl-Carp.noarch 0:1.22-2.fc17
perl-Compress-Raw-Bzip2.i686 0:2.052-1.fc17
perl-Compress-Raw-Zlib.i686 0:2.052-1.fc17
perl-Coro.i686 0:6.07-3.fc17
perl-Curses.i686 0:1.28-5.fc17
perl-DBD-MySQL.i686 0:4.020-2.fc17
perl-DBI.i686 0:1.617-1.fc17
perl-EV.i686 0:4.03-8.fc17
perl-Encode-Locale.noarch 0:1.02-5.fc17
perl-Event.i686 0:1.20-1.fc17
perl-Event-Lib.i686 0:1.03-16.fc17
perl-Glib.i686 0:1.241-2.fc17
perl-Guard.i686 0:1.022-1.fc17
perl-HTML-Parser.i686 0:3.69-3.fc17
perl-HTML-Tagset.noarch 0:3.20-10.fc17
perl-HTTP-Date.noarch 0:6.00-3.fc17
perl-HTTP-Message.noarch 0:6.03-1.fc17
perl-Heap.noarch 0:0.80-10.fc17
perl-IO-AIO.i686 0:4.15-1.fc17
perl-IO-Async.noarch 0:0.29-7.fc17
perl-IO-Compress.noarch 0:2.052-1.fc17
perl-IO-Socket-SSL.noarch 0:1.66-1.fc17
perl-IO-Tty.i686 0:1.10-8.fc17
perl-LWP-MediaTypes.noarch 0:6.01-4.fc17
perl-Module-Pluggable.noarch 1:3.90-218.fc17
perl-Net-HTTP.noarch 0:6.02-2.fc17
perl-Net-LibIDN.i686 0:0.12-8.fc17
perl-Net-SSLeay.i686 0:1.48-1.fc17
perl-POE.noarch 0:1.350-2.fc17
perl-PathTools.i686 0:3.33-218.fc17
perl-Pod-Escapes.noarch 1:1.04-218.fc17
perl-Pod-Simple.noarch 1:3.16-218.fc17
perl-Scalar-List-Utils.i686 0:1.25-1.fc17
perl-Socket.i686 0:2.001-1.fc17
perl-Socket-GetAddrInfo.i686 0:0.19-1.fc17
perl-Socket6.i686 0:0.23-8.fc17
perl-TermReadKey.i686 0:2.30-14.fc17
perl-TimeDate.noarch 1:1.20-6.fc17
perl-URI.noarch 0:1.60-1.fc17
perl-common-sense.noarch 0:3.5-1.fc17
perl-libs.i686 4:5.14.3-218.fc17
perl-macros.i686 4:5.14.3-218.fc17
perl-threads.i686 0:1.86-2.fc17
perl-threads-shared.i686 0:1.40-2.fc17

Complete!

2. Start mysql service:

[root@fedora17 ~]# systemctl start mysqld.service

3. Configuring mysql to be automatically started at boot time:

[root@fedora17 ~]# systemctl enable mysqld.service
ln -s ‘/usr/lib/systemd/system/mysqld.service’ ‘/etc/systemd/system/multi-user.target.wants/mysqld.service’

4. Connect to MySQL:

[root@fedora17 ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.28 MySQL Community Server (GPL)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

5. Query user info:

mysql> select user,host,password from mysql.user;
+——+————-+————-+
| user |     host     | password |
+——+————-+————-+
| root | localhost   |                |
| root | fedora17   |                |
| root | 127.0.0.1  |                |
| root | ::1            |                 |
|        | localhost   |                 |
|        | fedora17  |                 |
+—–+————-+————-+
6 rows in set (0.00 sec)

6. Set root password:

mysql> set password for root@localhost=password(‘******’);
Query OK, 0 rows affected (0.00 sec)

mysql> set password for root@’127.0.0.1’=password(‘******’);
Query OK, 0 rows affected (0.00 sec)

mysql> set password for root@’fedora17’=password(‘******’);
Query OK, 0 rows affected (0.00 sec)

7. Query user info after setting password:

mysql> select user,host,password from mysql.user;
+——+———–+———————————————————————+
| user | host       | password                                                                      |
+——+———–+———————————————————————+
| root | localhost | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| root | fedora17 | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| root | 127.0.0.1 | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| root | ::1           |                                                                                      |
|        | localhost  |                                                                                      |
|        | fedora17  |                                                                                      |
+—–+————-+——————————————-+
6 rows in set (0.01 sec)

8. Disconnect to mysql:

mysql> exit
Bye

9.Reconnect to test the result:

[root@fedora17 ~]# mysql -u root -p # connect mysql as root
Enter password:                                 # Enter MySQL root password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.28 MySQL Community Server (GPL)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> exit

That’s all. Thanks for using IThelpblog.com.

Tags:  

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>