mysql 數(shù)據(jù)庫基礎(chǔ)筆記

mysql 數(shù)據(jù)庫基礎(chǔ)筆記,剛開始接觸mysql的朋友可以參考下

進(jìn)入 安裝目錄…/bin/mysql.exe

cd 更換目錄 dir列出當(dāng)前目錄所有文件

c:vesa…a> 尖括號表示在c盤/的vasa/的…/的a 文件夾里面

cd空格.. 表示向上一級目錄

cd空格目錄名 表示進(jìn)入指定目錄

cd空格ted健 表示順序查看目錄名

>mysql 空格 -u用戶名 -p密碼 (即通過用戶名 密碼連數(shù)據(jù)庫)

show databases; 顯示所有數(shù)據(jù)庫

use 數(shù)據(jù)庫名; 表示進(jìn)入數(shù)據(jù)庫

show tables; 顯示所有數(shù)據(jù)表

select * from 數(shù)據(jù)表名; 查看數(shù)據(jù)表里的數(shù)據(jù)

插入:insert into 字段名(省略不寫的表示所以字段)values 值; (字段名1->值1 字段名2->值2…順序一樣個(gè)數(shù)一樣)

更新:update 表名 set 字段名 = 值; (where 字段名=值 and 字段名=值)

查詢:select 字段列表 from 表名;(where 字段名=值 and 字段名=值)

刪除:delete from 表名;(where 字段名=值 and 字段名=值)

創(chuàng)建數(shù)據(jù)庫:create database 數(shù)據(jù)庫名;

刪除列表:drop table 表名 …;

刪除數(shù)據(jù)庫:drop database 數(shù)據(jù)庫名;

查看表屬性:describe 表名;

修改表屬性:alter table 表名 modify column 字段名 類型;

修改表名:rename table 原表名 to 以后的表名;

創(chuàng)建數(shù)據(jù)表:create table 數(shù)據(jù)表名(項(xiàng)名 類型 . .,項(xiàng)名 類型 . .,……);

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊9 分享