mysql的cmd窗口查看數據庫信息


 

1.mysql -uroot -p 123456

2.show databases; 查看全部數據庫

3.select database(); 查看當前數據庫

4.show variables like 'port';

5. 查看當前數據庫大小,如查看springdata庫大小

select concat(round(sum(data_length)/(1024*1024),2) + round(sum(index_length)/(1024*1024),2),'MB') as 'DB Size'
-> from tables
-> where table_schema='springdata';

6. 查看數據所占有的空間

select concat(round(sum(data_length)/(1024*1024),2),'MB') as 'DB Size'
-> from tables
-> where table_schema='springdata';

7.查看索引所占用的空間

select concat(round(sum(index_length)/(1024*1024),2),'MB') as 'DB Size'
-> from tables
-> where table_schema='INVOICE';

8.查看數據庫編碼

 show variables like 'character%';

9.status

10.show tables;

11. 查看權限

  show grants for 'root'@'localhost';

12.某個人的權限

show grants for 'root'@'localhost';


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM