日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
MySQL數(shù)據(jù)庫(kù)的基本操作演示

以下的文章主要向大家描述的是MySQL數(shù)據(jù)庫(kù)的基本操作,提及MySQL數(shù)據(jù)庫(kù)我們大家對(duì)其可能都會(huì)有一定的了解,今天我們就和大家一起討論一下MySQL數(shù)據(jù)庫(kù)的基本操作,望你能有所收獲。

登陸數(shù)據(jù)庫(kù)

D:\phpStudy\MySQL\bin>MySQL -uroot -proot

查看數(shù)據(jù)庫(kù)

MySQL> show databases;

選擇數(shù)據(jù)庫(kù)

MySQL> use bugfree;

設(shè)置字符集

MySQL> set names 'gbk';

查詢數(shù)據(jù)庫(kù)中的表

MySQL> show tables;

MySQL數(shù)據(jù)庫(kù)的基本操作 ;創(chuàng)建表

MySQL> create table test(

-> tid int(10) not null,

-> tname varchar(100) not null,

-> tdate datetime not null default '0000-00-00',

-> primary key (tid));

查看表結(jié)構(gòu)

MySQL> desc test;

添加列

MySQL> alter table test add(tage int(3));

修改原表結(jié)構(gòu)

MySQL> alter table test modify tage int(5) not null;

修改列的默認(rèn)值

MySQL> alter table test alter tage set default '0';

去掉列的默認(rèn)值

MySQL> alter table test alter tage drop default;

刪除列

MySQL> alter table test drop column tage;

插入數(shù)據(jù)

MySQL> insert into test(tid,tname,tdate) value(1,'yangjuqi','2008-03-21');

查詢數(shù)據(jù)

MySQL> select * from test;

模糊查詢

MySQL> select * from test where tname like '%楊%';

MySQL數(shù)據(jù)庫(kù)的基本操作 :修改數(shù)據(jù)

MySQL> update test set tname='張三' where tid='2';

刪除數(shù)據(jù)

MySQL> delete from test where tid='2';

刪除表

MySQL> drop table test;

重命名表

MySQL> alter table test rename testbak;

分頁(yè)查詢(limit 起始行,取多少行)

MySQL> select * from testbak limit 2,1;

刷新數(shù)據(jù)庫(kù)

MySQL> flush privileges;

顯示數(shù)據(jù)庫(kù)版本

MySQL> select version();

顯示當(dāng)前時(shí)間

MySQL> select current_date;

修改用戶密碼

D:\phpStudy\MySQL\bin>MySQLadmin -uroot -proot password yangjuqi

將查詢出的數(shù)據(jù)寫入文件

MySQL> select * from testbak into outfile "d:/test.txt" fields terminated by ",";

查看數(shù)據(jù)庫(kù)狀態(tài)

MySQL> status;

查看所有編碼

MySQL> show variables like 'character_set_%';

導(dǎo)入sql文件命令

以上的相關(guān)內(nèi)容就是對(duì)MySQL數(shù)據(jù)庫(kù)的基本操作的介紹,望你能有所收獲。


標(biāo)題名稱:MySQL數(shù)據(jù)庫(kù)的基本操作演示
文章鏈接:http://m.5511xx.com/article/cdjhsec.html