mysql多表查詢sql語句 如何查看當(dāng)前mysql數(shù)據(jù)庫的表,和當(dāng)前有多少數(shù)據(jù)庫?
如何查看當(dāng)前mysql數(shù)據(jù)庫的表,和當(dāng)前有多少數(shù)據(jù)庫?你好!打開數(shù)據(jù)庫連接并輸入:show databases以顯示當(dāng)前數(shù)據(jù)庫中的數(shù)據(jù)庫數(shù)。輸入:使用Mysql切換到數(shù)據(jù)庫。只有切換到數(shù)據(jù)庫才能查看數(shù)
如何查看當(dāng)前mysql數(shù)據(jù)庫的表,和當(dāng)前有多少數(shù)據(jù)庫?
你好
!打開數(shù)據(jù)庫連接并輸入:show databases以顯示當(dāng)前數(shù)據(jù)庫中的數(shù)據(jù)庫數(shù)。
輸入:使用Mysql切換到數(shù)據(jù)庫。只有切換到數(shù)據(jù)庫才能查看數(shù)據(jù)庫中的表
輸入:show tables查看當(dāng)前數(shù)據(jù)庫中的表數(shù)
使用select命令查詢所有表名。寫入方法如下:從信息中選擇表名schema.tables表其中table Schema=“current database”其他用法1。使用show語句找出服務(wù)器上當(dāng)前存在的數(shù)據(jù)庫:MySQL> show databases 2。創(chuàng)建數(shù)據(jù)庫mysqldatamysql>創(chuàng)建數(shù)據(jù)庫mysqldata3。選擇您創(chuàng)建的數(shù)據(jù)庫MySQL>使用mysqldata?。?. 檢查當(dāng)前數(shù)據(jù)庫中存在哪些表MySQL> show tables5,創(chuàng)建一個數(shù)據(jù)庫表MySQL> create table mytable(name varchar(20),sex char(1))6,顯示該表的結(jié)構(gòu):MySQL> descripe mytable7,添加MySQL> insert到mytable中的記錄值到表(HYQ,m)8。通過文本(例如,D:m)將數(shù)據(jù)加載到數(shù)據(jù)庫表中/mysql.txt文件)mysql>加載數(shù)據(jù)本地填充/mysql.txt文件“輸入表mytable9,導(dǎo)入。SQL文件命令(例如,D:/mysql.sql數(shù)據(jù)庫)mysql>use數(shù)據(jù)庫mysql>source d:/mysql.sql數(shù)據(jù)庫
mysql查詢數(shù)據(jù)庫中有多少表?
連接到數(shù)據(jù)庫的服務(wù)器:MySQL-U用戶名-P密碼查看數(shù)據(jù)庫中的所有數(shù)據(jù)庫:Show databases create a database directly create a create database name創(chuàng)建數(shù)據(jù)庫以防止重復(fù)創(chuàng)建如果不存在創(chuàng)建數(shù)據(jù)庫數(shù)據(jù)庫名稱設(shè)置編碼格式:創(chuàng)建數(shù)據(jù)庫字符集編碼格式(utf8或GBK)修改數(shù)據(jù)庫編碼格式alter database name字符集編碼格式切換database use database name查看當(dāng)前選定的數(shù)據(jù)庫select database()delete database drop database database name view database creation語句顯示創(chuàng)建數(shù)據(jù)庫數(shù)據(jù)名稱