About The Author

This is a sample info about the author. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis.

Get The Latest News

Sign up to receive latest news

Tuesday 23 August 2011

MySQLAdmin Command

mysqladmin is a client for performing administrative operations.
You can use it to check the server’s configuration and current status,
create and drop databases, and more.

Check whether MySQL Server is up and running?
mysqladmin -u root -p ping
Find out what version of MySQL I am running
mysqladmin -u root -proot version
Current status of MySQL server
mysqladmin -u root -proot status
Variable Names and Description:
Uptime: Uptime of the mysql server in seconds
Threads: Total number of clients connected to the server.
Questions: Total number of queries the server has executed since the startup.
Slow queries: Total number of queries whose execution time was more than long_query_time variable’s value.
Opens: Total number of tables opened by the server.
Flush tables: How many times the tables were flushed.
Open tables: Total number of open tables in the database.

View all the MySQL Server status variable and it's current value
mysqladmin -u root -proot extended-status
To display all MySQL server system variables and the values
mysqladmin -u root -proot variables
To display all the running process/queries in the mysql database
mysqladmin -u root -proot processlist
Create a MySQL Database
mysqladmin -u root -proot create testdb
Delete/Drop an existing MySQL database
mysqladmin -u root -proot DROP testdb
Reload/refresh the privilege or the grants tables
mysqladmin -u root -proot reload
mysqladmin -u root -proot refresh
Shutdown the MySQL Server:
mysqladmin -u root -proot shutdown
Kill a hanging MySQL Client Process
mysqladmin -u root -proot kill processID

Note: In above examples, -proot,-p represents the password of the mysqladmin server and there should not be space between -p and password.

0 comments:

Post a Comment