时间:2021-07-01 10:21:17 帮助过:4人阅读
模式1:交互式模式
mysql> select database();
+------------+
| database() |
+------------+
| mysql |
+------------+
mysql> source /root/test/test.sql;Query OK, 1 row affected (0.00 sec)Database changedQuery OK, 0 rows affected (0.01 sec)
create database testdb2;
use testdb2;
create table student(id int,name char(20),age char(3));
mysql> \R mysql>
PROMPT set to ‘mysql> ‘
2)drop databse_name
# mysqladmin crate test1 create test2
3)processlist
# mysqladmin drop testdb2 drop testdb3
4)status
# mysqladmin processlist
+----+------+-----------------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------------+----+---------+------+-------+------------------+
| 33 | root | localhost:50637 | | Query | 0 | | show processlist |
+----+------+-----------------+----+---------+------+-------+------------------+
--sleep N:显示频率 --count N: 显示多个状态
# mysqladmin status
Uptime: 15903 Threads: 1 Questions: 140 Slow queries: 0 Opens: 39 Flush tables: 1 Open tables: 32 Queries per second avg: 0.008
5)extended-status: 显示状态变量
# mysqladmin status --sleep 3 --count 5
6)variables: 显示服务器变量
# mysqladmin extended-status | less
7)flush-privileges: 让mysqld重读授权表, 等同于reload;
# mysqladmin variables | less
8)flush-status,重置大多数的服务器状态变量,将一些变量置零9)flush-logs: 二进制和中继日志滚动10)flush-hosts:由于多次错误连接的导致登录被限制,为了让其重新登录,清除内部信息和DNS缓存11)refresh: 相当于同时执行flush-hosts和flush-logs12)shutdown: 关闭mysql服务器进程13)version: 服务器版本及当前状态信息;14)kill,注意杀死多个线程,comma前后不能有空格
# mysqladmin flush-privileges
15)start-slave: 启动复制,启动从服务器复制线程; SQL thread IO thread16)stop-slave: 关闭复制;
mysqladmin kill 50
mysqladmin kill 50,55
mysql客户端工具
标签:客户端 mysql style