MySQL之常用命令行查询

 命令行操作

  1) 查询字符集

show variables like 'character%';

   

  2)查看版本

select version();

 

 

  3) 共享表空间的数据文件存储路径

show variables like 'innodb_data%';

 

 

  4) 查看是哪种类型的表空间

show variables like '%innodb_file_per_table%';

 

  5) MySql数据库物理文件存放位置

show VARIABLES like '%datadir%';

 

  6) 查看某个配置项sql_model

select @@sql_mode;

 

  7)获取到mysql的安装路径

select @@basedir; 

 

 

终端操作:

  1)查询mysql的配置文件加载路径(同时可以验证配置文件是否有错误)

mysql --help|grep 'Default options' -A 1

/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf

 

posted @ 2019-11-09 11:02  X-Wolf  阅读(261)  评论(0编辑  收藏  举报