日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql常用命令orderby_MySQL常用命令总结

發(fā)布時間:2023/12/31 数据库 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql常用命令orderby_MySQL常用命令总结 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

MySQL數(shù)據(jù)庫對大小寫不敏感,如id和ID,select和SELECT.。

1.數(shù)據(jù)庫

create database ? 創(chuàng)建數(shù)據(jù)庫

use?? 連接數(shù)據(jù)庫

注:use表示當前連接上了哪個數(shù)據(jù)庫,并不會影響對其他數(shù)據(jù)庫的訪問

如: use db_1;

select * from db_2.logs

drop database? 刪除數(shù)據(jù)庫,不會提箱

drop database if exists? 如果存在,刪除數(shù)據(jù)庫

show databases? 查詢所有數(shù)據(jù)庫

select version() 查詢數(shù)據(jù)庫版本

select database() 查詢數(shù)據(jù)庫名稱

2.表

show tables 查詢所有表

create table ( [,... ] )?? 創(chuàng)建數(shù)據(jù)庫

drop table? ? 刪除表

drop table if exist? ? 如果存在,刪除表

rename table to

delete from where 刪除表中數(shù)據(jù)

insert into [([,.. ])] values ( 值1 )[, ( 值n )] 插入數(shù)據(jù)

update set 字段=值, ... where ? 更新表中數(shù)據(jù)

select from where order by limit m,n group by having ? 查詢

alert table add? [... 其他]? 給表增加字段

alert table drop ? 刪除表中的字段

alert table change ?? ? 修改表中字段

show index from ? 查詢索引

show keys from ? 查詢索引

alert table add index () 給表添加索引

alert table add unique () 給表添加唯一索引

alert table add primary key ()?? 給表中的主鍵添加索引

3.備份

mysqldump -u -p ? >? 導出的文件名??????? 導出數(shù)據(jù)庫,導出文件默認在mysql/bin目錄下

mysqldump -u -p ? ?? >? 導出的文件名

總結(jié)

以上是生活随笔為你收集整理的mysql常用命令orderby_MySQL常用命令总结的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。