- Download the MySQL Yum Repository and launch the downloaded RPM.
- Install MySQL on Fedora, Version 20, which you can find with the following command:
shell> rpm -qa | grep mysql
mysql-community-release-fc20-5.noarch
|
The fc20-5
changes with point releases, but assuming that you’re installing the fc20-5
release:
shell> sudo yum localinstall mysql-community-release-fc20-5.noarch.rpm
|
- Install MySQL on Fedora with the following command:
shell> sudo yum install mysql-server
|
- Start the MySQL service on Fedora with the following command:
shell> sudo service mysqld start
|
- Secure the MySQL installation with the following command:
shell> mysql_secure_installation
|
- Set the MySQL Service to start with the Fedora operating system with the following command (not
chkconfig
):
shell> sudo systemctl enable mysqld.service
|
It sets the following two links:
ln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/mysql.service'
ln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/multi-user.target.wants/mysqld.service'
|
Restart the Fedora operating system to effect the changes.
- Reset the MySQL configuration file to enable external connections through Port 3306 with the following changes to the my:
Remark out the socket
line, like this:
#socket=/var/lib/mysql/mysql.sock
|
Add the bind-address
and port
lines below after you know the actual IP address of the server to the my.cnf
file in the /etc
directory.
You substitute the actual IP address for the nnn.nnn.nnn.nnn
on the bind_address
line with the actual IP address returned by the ifconfig
command, like this:
Then, add these two lines to the my.cnf file.
bind-address=nnn.nnn.nnn.nnn
port=3306
|
It’s actually easier to use localhost.localdomain than an IP address when you use DHCP, like:
bind-address=localhost.localdomain
port=3306
|
If you plan to connect from a host system, like Windows or Mac OS X, to a virtual Linux environment using DHCP, change localhost.localdomain
to 0.0.0.0
:
bind-address=0.0.0.0
port=3306
|
- Restart the mysqld service with the following syntax:
shell> sudo service mysqld restart
|
You can check whether MySQL is listening on Port 3306 with this syntax:
shell> sudo netstat –anp | grep 3306
|
It displays:
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1311/mysqld
|