11. How to reload/refresh MySQL Privileges?
# mysqladmin -u root -p reload;
# mysqladmin -u root -p refresh
12. How to shutdown MySQL server Safely?
# mysqladmin -u root -p shutdown
# /etc/init.d/mysqld stop
# /etc/init.d/mysqld start
13. Some useful MySQL Flush commands
# mysqladmin -u root -p flush-hosts
# mysqladmin -u root -p flush-tables
# mysqladmin -u root -p flush-threads
# mysqladmin -u root -p flush-logs
# mysqladmin -u root -p flush-privileges
# mysqladmin -u root -p flush-status
- flush-hosts: Flush all host information from host cache.
- flush-tables: Flush all tables.
- flush-threads: Flush all threads cache.
- flush-logs: Flush all information logs.
- flush-privileges: Reload the grant tables (same as reload).
- flush-status: Clear status variables
14. How to kill Sleeping MySQL Client Process?
# mysqladmin -u root -p processlist
Enter password:
+----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+----+---------+------+-------+------------------+
| 5 | root | localhost | | Sleep | 14 | | |
| 8 | root | localhost | | Query | 0 | | show processlist |
+----+------+-----------+----+---------+------+-------+------------------+
# mysqladmin -u root -p kill 5
Enter password:
+----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+----+---------+------+-------+------------------+
| 12 | root | localhost | | Query | 0 | | show processlist |
+----+------+-----------+----+---------+------+-------+------------------+
To Kill multiple:
# mysqladmin -u root -p kill 5,10
15. How to run multiple mysqladmin commands together?
# mysqladmin -u root -p processlist status version
Enter password:
+----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+----+---------+------+-------+------------------+
| 8 | root | localhost | | Query | 0 | | show processlist |
+----+------+-----------+----+---------+------+-------+------------------+
Uptime: 3801 Threads: 1 Questions: 15 Slow queries: 0
Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.003
mysqladmin Ver 8.42 Distrib 5.5.28, for Linux on i686
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Server version 5.5.28
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 1 hour 3 min 21 sec
16. How to Connect remote mysql server ?
# mysqladmin -h 19x.1x.x5.22x -u root -p
17. How to execute command on remote MySQL server?
# mysqladmin -h 19x.1x.x5.22x -u root -p status
18. How to start/stop MySQL replication on a slave server?
# mysqladmin -u root -p start-slave
# mysqladmin -u root -p stop-slave
19. How to store MySQL server Debug Information to logs?
# mysqladmin -u root -p debug
20. How to view mysqladmin options and usage ?
# mysqladmin --help
No comments:
Post a Comment