Abbey Workshop

MySQL: Testing a MySQL Installation

After you've installed mySQL, there are a few commands you can issue to make sure that your configuration is working.

First, make sure you have started both the client and server. Once that is done, from the client command prompt, type the following command:

mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| test |
+----------+

2 rows in set (0.05 sec)

mysql>

After an install, this command shows the two default databases included with the install. The test database does not have any tables in it. So, let's see what tables are in the mysql database. First, select the database.

mysql> use mysql;
Database changed
mysql>

Next, list the tables contained in the mysql database.

mysql> show tables;
+-----------------+
| Tables_in_mysql |
+-----------------+
| columns_priv |
| db |
| host |
| tables_priv |
| user |
+-----------------+
5 rows in set (0.06 sec)

mysql>

To see the data in the db database, use the following command.

mysql> select * from db;
+------+-------+------+-------------+----------
---+-------------+-------------+-

------------+-----------+------------+---------
--------+------------+-----------
-+

| Host | Db | User | Select_priv | Insert_priv
| Update_priv | Delete_priv |

Create_priv | Drop_priv | Grant_priv |
References_priv | Index_priv | Alter_priv

|
+------+-------+------+-------------+----------
---+-------------+-------------+-

------------+-----------+------------+---------
--------+------------+------------+

| % | test% | | Y | Y | Y | Y |
Y | Y | N | Y | Y | Y
|
+------+-------+------+-------------+----------
---+-------------+-------------+-

------------+-----------+------------+---------
--------+------------+------------+

1 row in set (0.00 sec)

mysql>

These steps should verify that mySQL has been installed on your system.