November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Mysqladmin Tips

Here we can see some tips with mysqladmin tool
To check the status of mysqld
# mysqladmin -u root -pmysql ping
# service mysqld status
# mysqladmin -u root -pmysql status

 

To find mysql version
# mysqladmin -u root -pmysql version

 

To view all the MySQL Server status variable and it s current value.
# mysqladmin -u root -pmysql extended-status

 

To display all MySQL server system variables and the values
# mysqladmin -u root -pmysql variables

To display all the running process/queries in the mysql database.

# mysqladmin -u root -pmysql processlist

# mysqladmin -u root -pmysql processlist -i 1  —- run this command automatically every 1 second.

To create a DB
# mysqladmin -pmysql create DBtest

 

To Drop a DB
# mysqladmin -pmysql drop DBtest

 

To reload mysqld demon
# mysqladmin -pmysql reload
# mysqladmin -pmysql refrsh

 

To stop mysql daemon
# mysqladmin -pmysql shutdow

 

Note: You can also use /etc/rc.d/init.d/mysqld stop to shutdown the server. To start the server, execute /etc/rc.d/init.d/mysql start

 

Mysql flush
# mysqladmin -pmysql flush-hosts
# mysqladmin -pmysql flush-logs
# mysqladmin -pmysql flush-privileges
# mysqladmin -pmysql flush-status
# mysqladmin -pmysql flush-tables
# mysqladmin -pmysql flush-threads



flush-hosts: Flush all information in the host cache.

flush-privileges: Reload the grant tables (same as reload).
flush-status: Clear status variables.
flush-threads: Flush the thread cache.
To start and stop MySQL replication on a slave server
# mysqladmin -u root -pmysql stop-slave
# mysqladmin -u root -pmysql start-slave

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>