How Can We Help?

Using Fedora 20 MySQL Relational Databases

Table of Content
Introduction

MySQL is a widespread database management system that thousands of web and server applications use as their primary data storage provider.

Install MySQL

To bring your system up to date and install MySQL, type in the following commands:

#yum update
#yum install mysql-server
#chkconfig mysqld on

*Your server will have the MySQL server package and all of its dependencies and client libraries installed automatically. You can begin using MySQL by executing the following command:

#service mysqld start

Configuring MySQL

After installing MySQL, it is highly recommended that you run the programme known as mysql secure installation, which assists in securing MySQL. While you are in the process of running mysql secure installation, you will be given the opportunity to change the MySQL root password, get rid of anonymous user accounts, disable root logins from anywhere other than localhost, and get rid of test databases. It is strongly suggested that you select yes for these available options. If asked to reload the privilege tables, choose the yes option when prompted. To start the programme, you need to run the following command:

#mysql_secure_installation

By default, MySQL will utilise the localhost connection (IP address 127.0.0.1). If you want to connect your local clients to MySQL remotely, we recommend consulting our secure remote access guide.

Although it is not recommended to make MySQL accessible from a public IP, you can alter the address on which it listens by editing the bind-address parameter in /etc/my.cnf. MySQL binding to a public IP requires special firewall configuration to restrict access to authorised users.

If you have modified MySQL's settings, you must restart the server with the following command:

#service mysqld restart

Login mysql

The most common way to talk to MySQL is through the mysql client programme. To get started, type the following command at your prompt:

#mysql -u root -p

*After login you will face below interface

mysql>

Make a database and give it a user.

#CREATE DATABASE microhostdb;
#CREATE USER 'microhost'@localhost IDENTIFIED BY 'password';
#GRANT ALL PRIVILEGES ON microhostdb.* TO 'microhost'@localhost;
#exit

How to Reset MySQL’s Root Password

#service mysqld stop
#mysqld_safe --skip-gr

ant-tables[/console]

#mysql -u root

The next step in the password reset process will take place inside the MySQL client software.

#USE mysql;
#UPDATE user SET PASSWORD=PASSWORD("password") WHERE User='root';
#FLUSH PRIVILEGES;
#exit

In order to restart MySQL, type in the following command:

#service mysqld restart

Tuning MySQL

MySQL Tuner connects to a running MySQL instance and recommends configurations based on workload. MySQL should have been running for 24 hours before running the tuner. The longer the instance has run, the better MySQL Tuner's advice.

#yum install mysqltuner

Simply enter: to begin using MySQL Tuner.

#mysqltuner

Please keep in mind that this tool is intended to provide configuration suggestions and is an excellent starting point. It would be prudent to conduct additional research for tuning configurations based on the application(s) that use MySQL.

Thank You

Tags:
Table of Contents