Quick Tip: Installing MySQL on Fedora Linux

Installing MySQL on Fedora has never been easier than before. If you are a first timer who wants to know how to install MySQL on a Fedora server or desktop, follow this guide to successfully install both MySQL client and server only in three steps.

Before you proceed to the installation, the environment settings for the snapshot pictures of the installation are provided below:
OS: Fedora 13 64-bit
Prerequisites: yum is installed, commands invoked on root shell

Step 1: Install mysql client and mysql server via yum

Command:

root# yum install mysql mysql-server

Snapshots:

Step 2: Configure MySQL daemon (mysqld) to be started whenever the server is rebooted. This way MySQL will automatically start after reboot without you having to manually initialize the service from command prompt.

Command:

root# chkconfig --level 2345 mysqld on

Alternatively:

root# /sbin/chkconfig --level 2345 mysqld on

Snapshot:

Step 3: Create the first databases by starting mysql service from the command prompt. Invoking this command will create test and mysql databases in your system. However, test database is not essential. You can drop this database later from MySQL console.

Command:

root# service mysqld start

Alternatively:

root# /sbin/service mysqld start

Snapshot:

CONGRATULATIONS!! We are done with the installation.

After completing the installation, you will have a running database server and a root account to manage the databases. You may consider changing the root password by invoking mysqladmin command (please refer to screenshot in Step 3) or logging into mysql console and update the password. Since you may update the password several times in the future, you will be shown the additional steps to updating the root password from MySQL console.

Additional Step 1: Login to mysql console from the command prompt

Command:

root# mysql -u root

Snapshot:

Additional Step 2: Change active database into mysql

Command:

mysql> use mysql;

Snapshot:

Additional Step 3: Update the password for root account

Command:

mysql> update user set password=password('your-new-password') where user='root';

Snapshot:

Additional Step 4: Quit the MySQL console and activate the change by reloading MySQL databases from the command prompt

Command:

mysql> quit;
root# mysqladmin -u root reload

Snapshot:

Note: Since root password is initially empty. We don’t need to supply -p (password) flag. Once you have set up the password, you should modify the above command by adding extra -p flag every time you want to reload MySQL after root password change. Don’t forget to supply your old root password instead of your new root password since at the time you invoke the command, password change has not taken place.
After the password change is effective, you should also add -p flag evertime you connect to MySQL server from the command prompt.

Have fun!!

6 thoughts on “Quick Tip: Installing MySQL on Fedora Linux

  1. Pingback: Quick Tip: Installing MySQL on Fedora Linux at Amikelive … | mysql

  2. Pingback: Quick Tip: How to Install and Configure PHP in Fedora Linux at Amikelive | Technology Blog

  3. Junaid

    Thank you so much for your kind words! I’m glad you found the content amazing. It’s my pleasure to assist and provide valuable information. If you have any more topics or questions you’d like to explore, feel free to let me know. Keep engaging and enjoying the content!

    Reply
  4. Prateek Karnadhar

    Can you provide some insight into any potential challenges or considerations that users might encounter while following the steps you’ve outlined for installing MySQL on Fedora? Additionally, could you offer guidance on troubleshooting common issues that could arise during the installation process, especially for those who might be new to working with databases and Linux systems? Your expertise would greatly help users navigate any roadblocks they might face and ensure a smooth installation experience.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *