MySQL II : Initial Configuration

1. Before starting, install the MySQL servers, clients and development libraries. Run these queries, and if necessary, install the related packages (these commands are case-sensitive!):

rpm -q mysql
rpm -q mysql-server
rpm -q MySQL-python
rpm -q perl-DBD-MySQL
rpm -q php-mysql

All these packages should be installed. Use the Fedora CDs to add any that you need.

When you install from the Fedora CDs or RPMs, the mysql user and group will be created automatically, and directory permissions will be pre-set for you.

2. Set the root user’s password for MySQL: (See MMS4 7)

mysqladmin -u root password “private”

I will be using, as a default, the password “private” for all root connections. See the mysql/mysqladmin commands page as a reference.

4. Create a user configuration file for root: (See MMS4 269 ff.)

vi .my.cnf
gedit my.cnf &

Then in vi or gedit:


5. Create your own (Linux) user:

useradd glenn
passwd glenn
usermod -G mysql glenn

6. Create your own (MySQL) user. (See the users page for a refresher.) Enter the mysql monitor and command:

GRANT ALL ON *.* TO ‘glenn’@’localhost’ IDENTIFIED BY ‘public’;
#Don’t forget that semicolon! And do see the security page.

7. Applying Created Privileges: The Step You Must Not Forget

Use mysqladmin:

mysqladmin -u root -p flush-privileges
mysqladmin -u root -p reload

If you omit this step the new permissions will not be applied.

8. Log out as root and log back in as yourself.

9. Create your user configuration file (see 4 above).

10. Modify your PATH:

vi .bash_profile

Find the PATH variable, and to the end add: /usr/bin. It should look like:


11. Log out again, then log in as yourself again.

12. Test your ability to use the mysql and mysqladmin commands.