Home >> FAQs/Tutorials >> MySQL Tutorials >> Index

MySQL FAQs - Administrator Tools for Managing MySQL Server

By: FYIcenter.com

Part:   1   2  3  4 

A collection of 16 FAQs on MySQL administration tools. Clear answers are provided with tutorial exercises on server daemon; administrator and end user interfaces; checking and repairing tables; dumping and importing tables. Topics included in this collection are:

  1. What Tools Available for Managing MySQL Server?
  2. What Is "mysqld"?
  3. What Is "mysqladmin"?
  4. How To Check Server Status with "mysqladmin"?
  5. How To Shut Down the Server with "mysqladmin"?
  6. What Is "mysql"?
  7. How To Use "mysql" to Run SQL Statements?
  8. How To Show All Tables with "mysql"?
  9. What Is "mysqlcheck"?
  10. How To Analyze Tables with "mysqlcheck"?
  11. What Is "mysqlshow"?
  12. How To Show Table Names with "mysqlshow"?
  13. What Is "mysqldump"?
  14. How To Dump a Table to a File with "mysqldump"?
  15. What Is "mysqlimport"?
  16. How To Load Data Files into Tables with "mysqlimport"?

Please note that all answers and tutorials are based on MySQL 5.0.

What Tools Available for Managing MySQL Server?

MySQL comes with the following programs as administration tools for you to manage your MySQL server:

  • mysqld - MySQL server daemon. You can use "mysqld" to start your MySQL server.
  • mysqladmin - A command-line interface for administrators to perform server administration tasks.
  • mysql - A command-line interface for end users to manage user data objects.
  • mysqlcheck - A command-line interface for administrators to check and repair tables.
  • mysqlshow - A command-line interface for end users to see information on tables and columns.
  • mysqldump - A command-line interface for administrators or end users to export data from the server to files.
  • mysqlimport - A command-line interface for administrators or end users to load data files into tables program tool to load data into tables.

What Is "mysqld"?

"mysqld" is MySQL server daemon program which runs quietly in background on your computer system. Invoking "mysqld" will start the MySQL server on your system. Terminating "mysqld" will shutdown the MySQL server. Here is a tutorial example of invoking "mysqld" with the "--console" option:

>cd \mysql\bin
>mysqld --console
... 21:52:54  InnoDB: Started; log sequence number 0 43655
... 21:52:54 [Note] mysqld: ready for connections.
Version: '5.0.24-community'  socket: ''  port: 3306  
 MySQL Community Edition (GPL)

The returning message indicates that "mysqld" running now, and your MySQL server is ready to take client connections. To know about "mysqld", read other parts of this FAQ collection.

What Is "mysqladmin"?

"mysqladmin" is a command-line interface for administrators to perform server administration tasks. It support a number of commonly used commands like:

  • "mysqladmin shutdown" - Shuts down the server.
  • "mysqladmin ping" - Checks if the server is alive or not.
  • "mysqladmin status" - Displays several important server status values.
  • "mysqladmin version" - Displays version information of the server.
  • "mysqladmin create databaseName" - Creates a new database.
  • "mysqladmin drop databaseName" - Drops an existing database.

How To Check Server Status with "mysqladmin"?

If you want to check the server status by with "mysqladmin", you can following this tutorial example:

>cd \mysql\bin
>mysqladmin -u root status
Uptime: 223  Threads: 1  Questions: 1  Slow queries: 0 
 Opens: 12  Flush tables: 1  Open tables: 6 
 Queries per second avg: 0.004

The returning message indicates that the server is almost doing nothing at this moment. To know about "mysqladmin", read other parts of this FAQ collection.

How To Shut Down the Server with "mysqladmin"?

If you want to shut down the server with "mysqladmin", you can use the command "mysqladmin shutdown" as shown in the following tutorial example:

>cd \mysql\bin
>mysqladmin -u root shutdown

If this command returns no messages, your MySQL server should be terminated successfully.

(Continued on next part...)

Part:   1   2  3  4 


Selected Developer Jobs:

More...