O'Reilly logo

Fedora Linux by Chris Tyler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Databases and Accounts on a MySQL Server

MySQL is an open source database system that has become very popular due to its high performance, lightweight design, and open source license.

Many software packages, including web applications such as the Serendipity blog software (http://www.s9y.org/), use MySQL to store data. In order to use these programs, you will need to create a MySQL database and access account.

How Do I Do That?

First, you’ll need to select names for your database and access account; for this example, let’s use chrisblog for the database name and chris for the access account. Both names should start with a letter, contain no spaces, and be composed from characters that can be used in filenames.

To create the database and account, use the mysql monitor program:

# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.18

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database chrisblog;
Query OK, 1 row affected (0.01 sec)

mysql> grant all privileges on chrisblog.* to 
               
                  'chris'
               
               @'localhost' 
               identified by 
               
                  'SecretPassword'
               
               ;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

Tip

Make sure that the mysqld service is running!

You can then enter the database, access account, and password information into the configuration of whatever software will use MySQL.

Warning

MySQL recommends that you add a password to root’s access of the MySQL server. You can do that with these ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required