Home arrow MySQL arrow Page 8 - MySQL Installation and Configuration

Testing MySQL - MySQL

In this chapter, Vikram discusses how to obtain, install, configure, and test the MySQL server on Unix and Windows. It also explains the differences between the different MySQL sever versions available, with a view to helping you select the right one for your needs. This excerpt comes from chapter three of MySQL: The Complete Reference, by Vikram Vaswani (McGraw-Hill/Osborne, ISBN 0-07-222477-0, 2004).

  1. MySQL Installation and Configuration
  2. Choosing Between Binary and Source Distributions
  3. Installing and Configuring MySQL (Linux/Unix)
  4. Installing MySQL from a Binary Tarball Distribution (Linux/Unix)
  5. Installing MySQL from a Source Distribution (Linux/Unix)
  6. Installing and Configuring MySQL on Windows
  7. Installing MySQL from a Source Distribution (Windows)
  8. Testing MySQL
  9. Post-Installation Steps
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 134
April 28, 2004

print this article



After MySQL has been successfully installed, the base tables have been initialized, and the server has been started, you can verify that all is working as it should via some simple tests.

Note that all these commands should be run from your UNIX or Windows command prompt. I am assuming here that you are running them from your MySQL installation directory (as per the examples in the section “Installing and Configuring MySQL,” this will be either /usr/local/mysql in UNIX or c:\program files\mysql in Windows).

Use the mysqladmin Utility to Obtain Server Status

The mysqladmin utility is usually located in the bin subdirectory of your MySQL installation. You can execute it by changing to that directory and executing the following command:

[root@host]# mysqladmin version

You should see something resembling the output shown in Figure 22.

MySQL Installation and Configuration
FIGURE 22  The output of a call to mysqladmin

Connect to the Server Using the MySQL Client, and Execute Simple SQL Commands

The MySQL client that ships with the MySQL distribution is named, funnily enough, mysql. Fire it up from your command prompt by switching to the bin directory of your MySQL installation and typing

[root@host]# mysql

You should be rewarded with a mysql> prompt.

At this point, you are connected to the MySQL server and can begin executing SQL commands or queries. Here are a few examples, with their output:

| Database |
| mysql    |
| test     |
2 rows in set (0.13 sec)

mysql> USE mysql;

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed

| Tables_in_mysql |
| columns_priv    |
| db              |
| func            |
| host            |
| tables_priv     |
| user            |
6 rows in set (0.00 sec)

mysql> SELECT COUNT(*) FROM user;
| count(*) |
|        4 |
1 row in set (0.00 sec)

Remember: this is chapter three of MySQL: The Complete Reference, by Vikram Vaswani (McGraw-Hill/Osborne, ISBN 0-07-222477-0, 2004). Vikram is the founder of Melonfire, and has had numerous articles featured on Dev Shed. 
Buy this book now.

>>> More MySQL Articles          >>> More By McGraw-Hill/Osborne

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Oracle Unveils MySQL 5.6
- MySQL Vulnerabilities Threaten Databases
- MySQL Cloud Options Expand with Google Cloud...
- MySQL 5.6 Prepped to Handle Demanding Web Use
- ScaleBase Service Virtualizes MySQL Databases
- Oracle Unveils MySQL Conversion Tools
- Akiban Opens Database Software for MySQL Use...
- Oracle Fixes MySQL Bug
- MySQL Databases Vulnerable to Password Hack
- MySQL: Overview of the ALTER TABLE Statement
- MySQL: How to Use the GRANT Statement
- MySQL: Creating, Listing, and Removing Datab...
- MySQL: Create, Show, and Describe Database T...
- MySQL Data and Table Types
- McAfee Releases Audit Plugin for MySQL Users

Developer Shed Affiliates


Dev Shed Tutorial Topics: