新聞中心
MySQL的軟件架構(gòu)
印江ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書未來(lái)市場(chǎng)廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!
1.開啟MySQL服務(wù)器:以windows服務(wù)的形式開啟,在cmd下net startmysql|net stop mysql,在cmd下使用mysqld –default-file= “d:/amp/mysql/my.ini”
2.連接MySQL服務(wù)器
3.mysql的幫助命令,help,里面的指令都可以使用 \字母 來(lái)完成
4.mysql的注釋符:行注釋:#或-- ,塊注釋是/* */
數(shù)據(jù)庫(kù)的操作
創(chuàng)建數(shù)據(jù)庫(kù):create database 庫(kù)名[庫(kù)選項(xiàng)];
查看數(shù)據(jù)庫(kù):show databases; show createdatabase 庫(kù)名;
刪除數(shù)據(jù)庫(kù):drop database [if exists] 庫(kù)名
修改數(shù)據(jù)庫(kù):只能修改庫(kù)選項(xiàng);alter database 庫(kù)名新的庫(kù)選項(xiàng)
數(shù)據(jù)表操作
選擇數(shù)據(jù)庫(kù):顯式的選擇,在表名的前面加上庫(kù)名;隱式的選擇,use 庫(kù)名;
創(chuàng)建數(shù)據(jù)表:create table 表名(字段列表)[表選項(xiàng)];
查看數(shù)據(jù)表:show tables; show createtable 表名; describe|desc 表名;
修改數(shù)據(jù)表:
1修改表名:altertable 表名 rename to 新表名; rename table 舊表名 to 新表名
2修改列定義:
增加一列:alter table 表名 add 新字段名字段類型;
刪除一列:alter table 表名 drop 字段名;
修改字段類型:alter table 表名 modify 字段名新的字段類型
修改字段排序:alter table 表名 modify 字段名1 新的字段類型
first|after 字段名2
重命名字段:alter table 表名 change 舊字段名新字段名 新字段類型
3修改表選項(xiàng):altertable 表名新的表選項(xiàng)(default charset gbk engine Myisam)
數(shù)據(jù)操作
插入數(shù)據(jù):insert into 表名(字段列表)values(值列表)
查看數(shù)據(jù):select *|字段列表 from 表名 [where查詢條件]
刪除數(shù)據(jù):delete from 表名[where刪除條件]
修改數(shù)據(jù):update 表名 set 字段1=新值1,字段2=新值2……[where修改條件]
數(shù)值類型
1.整數(shù):tinyint,smallint, mediumint,int,bigint
2.小數(shù):
a.浮點(diǎn)數(shù)float/double
b.定點(diǎn)數(shù):decimal,也叫貨幣型
日期時(shí)間型
datetime和timestamp
date
time:時(shí)間間隔|一天中的時(shí)間
year:70以后的代表19XX,69及69以前的代表20XX
網(wǎng)站標(biāo)題:Mysql基礎(chǔ)語(yǔ)法1
標(biāo)題路徑:http://ef60e0e.cn/article/ghhgci.html