Mysql 查詢所有表的行數和大小
SELECT TABLE_NAME,TABLE_ROWS,DATA_LENGTH/1024/1024 "DATA_LENGTH",CREATE_TIME,TABLE_COLLATION FROM
INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'lir' ORDER BY TABLE_ROWS DESC
- [[email protected] ~]$ mysql -u root -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 36
- Server version: 5.6.16 MySQL Community Server (GPL)
- Copyright (c) 2000, 2014, 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.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> show database;
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1
- mysql> show databases;
- +--------------------+
- | Database |
- +--------------------+
- | information_schema |
- | fire |
- | hive |
- | lir |
- | mysql |
- | performance_schema |
- | test |
- +--------------------+
- 7 rows in set (0.03 sec)
- mysql> use fire;
- Reading table information for completion of table and column names
- You can turn off this feature to get a quicker startup with -A
- Database changed
- mysql> load data infile 'aa.txt' into table firewallb;
- ERROR 13 (HY000): Can't get stat of '/var/lib/mysql/fire/aa.txt' (Errcode: 2 - No such file or directory)
- mysql> load data infile '/home/dss/aa.txt' into table firewallb;
- ERROR 13 (HY000): Can't get stat of '/home/dss/aa.txt' (Errcode: 13 - Permission denied)
- mysql> load data infile '/tmp/aa.txt' into table firewallb;
- Query OK, 10 rows affected (0.07 sec)
- Records: 10 Deleted: 0 Skipped: 0 Warnings: 0
- mysql> load data infile '/tmp/fireb.txt' into table firewallb;
- Query OK, 16600931 rows affected (38 min 25.54 sec)
- Records: 16600931 Deleted: 0 Skipped: 0 Warnings: 0
匯入資料檔案到mysql
mysql匯出資料到檔案
SELECT * INTO OUTFILE '/tmp/bb.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' FROM bb_month;
https://blog.csdn.net/wind520/article/details/38728655
相關推薦
Mysql 查詢所有表的行數和大小
SELECT TABLE_NAME,TABLE_ROWS,DATA_LENGTH/1024/1024 "DATA_LENGTH",CREATE_TIME,TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SC
SQL Server查看所有表大小、表行數和占用空間信息
add nvarchar 包含 desc cut ack sed dealloc har 一、查看表名和對應的數據行數select a.name as ‘表名‘,b.rows as ‘表數據行數‘from sysobjects a inner join sysindexe
關於Mysql 查詢所有表的實時記錄用於對比2個MySQL 庫的數據是否異步
執行 密碼 col fetchone con 網上 mysql密碼 方式 HERE Xu言: 今天,為了研究一個MySQL主從同步開機後報錯 問題,如下圖 故障原因分析: 經過分析,可能是主從服務器開機順序導致。(有待下次斷電再次測試) 主從錯誤提示:日誌讀取錯誤的
Postgresql統計所有表的基本資訊(如行數、大小等)
pg_class 目錄 pg_class 記錄表和幾乎所有具有列或者像表的東西。這包括索引(但還要參見 pg_index )、序列、檢視、物化檢視、組合型別和TOAST表。 pg_class 中的一些邏輯標誌被以一種懶惰的方式維護:在正確狀態時它們被保證為真,但
sql server 查詢所有表的行數記錄
SELECT a.name, b.rows FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id WHERE (a.type
mysql 查詢所有庫中所有表 表中大概記錄數
查詢資料庫中所有表名錶中資料量(不可靠)select table_name,table_rows from information_schema.tables where table_schema='databasename' order by table_rows des
mysql查詢資料庫表的資料行數
檢視mysql某個資料庫下所有表的資料總條數 use information_schema; select sum(TABLE_ROWS) from tables where TABLE_SCHEMA
Java獲得數據庫查詢結果的列數和行數,打印查詢結果
rman execute .get name 數據庫查詢 隨筆 while cti etc Java連接數據庫及簡單操作見我以前的一篇隨筆:http://www.cnblogs.com/meitian/p/5036332.html 一、獲取查詢結果的行數和列數 查詢結果
mysql 查詢所有資料庫中沒有主鍵的表
mysql 查詢所有資料庫中沒有主鍵的表: select table_schema,table_name from information_schema.tables where (table_schema,table_name) not in( select distinct t
20181005:python遍歷查詢資料庫所有表名和欄位,使用SQLAlchemy查詢所有表名
用sqlalchemy模組的方法(網上都是這個方法): from sqlalchemy import Column, String, create_engine from sqlalchemy.ext.declarative import declar
Mysql中的遞迴層次查詢(根據父節點查詢所有的子節點和根據子節點查詢所有的父節點)的兩種運用
1、根據子節點查詢所有的父節點 建立getParentList函式 SQL語句如下: delimiter // CREATEFUNCTION `getParentList`(rootId INT) R
實現一個函式,列印乘法口訣表,口訣表的行數和列數自己指定, 輸入9,輸出9*9口訣表,輸入12,輸出12*12的乘法口訣表。
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> int main() { int n = 0; printf("請輸入一個數:"); scanf("%d", &n);
1. 實現一個函式,列印乘法口訣表,口訣表的行數和列數自己指定, 輸入9,輸出9*9口訣表,輸出12,輸出12*12的乘法口訣表。
#define_CRT_SECURE_NO_WARNINGS1 #include<stdio.h> #include<stdlib.h> #include<math.h&
Oracle 查詢所有表的記錄數
場景:程式碼資料統計 方法一: select sum(num_rows) from (select t.table_name,t.num_rows from user_tables t) 方法二:
mysql 查詢兩表使用join on和使用子查詢in的比較
有兩個表 promotion_full_reduction base_user_favorite_item 現在要查詢使用者收藏的商品中參加促銷了的商品個數,有兩種寫法,一種是使用in子查詢: SELECT COUNT(1) FROM pr
mysql InnoDB引擎的行鎖和表鎖
引入 之前是有接觸行鎖和表鎖但是由於沒有實際應用過也只是大概瞭解,前兩天就遇到了併發同時對一條記錄進行修改。mysql肯定會讓修改請求排隊,也就是說加了鎖,但是mysql預設加的是表鎖,但是會影響效率,所以我們需要用行鎖。 行鎖和表鎖 表鎖:顧名思義就
sql查詢所有表的記錄數
CREATE TABLE #temp ( TableName VARCHAR(255) , RowCnt INT ) EXEC sp_MSforeachtable 'INSERT INTO #temp SELECT ''?'', COUNT(*) FROM ?'
//1.實現一個函式,列印乘法口訣表,口訣表的行數和列數自己指定, //輸入9,輸出9 * 9口訣表,輸出12,輸出12 * 12的乘法口訣表。
#include<stdio.h> int print(int num) {int i = 0;for (i = 1; i <= num; i++){int j = 0;for (
獲取SQL查詢結果集中的行數和列數
轉自http://cheneyph.iteye.com/blog/477829 在Java中,獲得ResultSet的總行數的方法有以下幾種。 第一種:利用ResultSet的getRow方法來獲得ResultSet的總行數 Statement stmt = con.cre
用C語言中的函式列印乘法口訣表,行數和列數可以任意輸入
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> void print_table(int line) { int i = 0;