MySQL数据库参数:msyql -e
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
[root@Mysql ~]# /usr/local/mysql/bin/mysql -uroot -p'admin' mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | bbs | | blog | | mysql | | performance_schema | | test | | www | +--------------------+ mysql> use bbs mysql> show tables; +-----------------------------------+ | Tables_in_bbs | +-----------------------------------+ | pre_common_admincp_cmenu | | pre_common_admincp_group | | pre_common_admincp_member | ##############其他省略############## | pre_ucenter_settings | | pre_ucenter_sqlcache | | pre_ucenter_tags | | pre_ucenter_vars | +-----------------------------------+ 293 rows in set (0.20 sec) ################################分隔符################################ [root@Mysql ~]# echo 'show databases;' | /usr/local/mysql/bin/mysql -uroot -p'admin' Warning: Using a password on the command line interface can be insecure. Database information_schema bbs blog mysql performance_schema test www [root@Mysql mysql]# ################################分隔符################################ [root@Mysql ~]# /usr/local/mysql/bin/mysql -uroot -p'admin' -e 'show databases;' Warning: Using a password on the command line interface can be insecure. +--------------------+ | Database | +--------------------+ | information_schema | | bbs | | blog | | mysql | | performance_schema | | test | | www | +--------------------+ [root@Mysql ~]# /usr/local/mysql/bin/mysql -uroot -p'admin' -e 'use bbs;show tables;' +-----------------------------------+ | Tables_in_bbs | +-----------------------------------+ | pre_common_admincp_cmenu | | pre_common_admincp_group | | pre_common_admincp_member | ##############其他省略############## | pre_ucenter_settings | | pre_ucenter_sqlcache | | pre_ucenter_tags | | pre_ucenter_vars | +-----------------------------------+ 293 rows in set (0.20 sec) [root@Mysql ~]# /usr/local/mysql/bin/mysql -uroot -p'admin' -e 'show full processlist;' #查看mysql线程状态 Warning: Using a password on the command line interface can be insecure. +----+------+-----------+------+---------+------+-------+-----------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------+------+---------+------+-------+-----------------------+ | 5 | root | localhost | NULL | Query | 0 | init | show full processlist | +----+------+-----------+------+---------+------+-------+-----------------------+ [root@Mysql ~]# /usr/local/mysql/bin/mysql -uroot -p'admin' -e 'show variables;' #查看系统变量及其值 [root@Mysql ~]# /usr/local/mysql/bin/mysql -uroot -p'admin' -e "show variables like 'wait_timeout';" Warning: Using a password on the command line interface can be insecure. +---------------+-------+ | Variable_name | Value | +---------------+-------+ | wait_timeout | 28800 | +---------------+-------+ [root@Mysql ~]# /usr/local/mysql/bin/mysql -uroot -p'admin' -e "show global status;" #查看数据库状态 |
申明:本文由BYRD原创(基于Mysql5.6.16),未经许可禁止转载!SourceByrd's Weblog-https://note.t4x.org/database/mysql-non-interactive/ SourceByrd's Weblog-https://note.t4x.org/database/mysql-non-interactive/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!