mysql如何在某個指定的資料庫中建表

2021-08-10 23:12:38 字數 1853 閱讀 7564

1樓:飛喵某

1、首先開啟mysql命令列編輯器。

2、開啟之後輸入密碼,連線資料庫。

3、在命令列裡先檢視一下所有資料庫,是否有想要運算元據庫。

4、接著輸入指令「use sss」使用想要建立表的資料庫。

5、接下來在表裡面輸入資料列,使用create命令建立表,括號內是表的類目名。

6、最後,輸入指令「show tables 」,就可以剛剛檢視在資料庫中建立的表了。

2樓:匿名使用者

如果在視覺化介面,如phpmyadmin中,可單擊資料庫,進入sql,寫語句建表。

如果是在mysql控制台,則如下所示:

e:\program files (x86)\mysql\mysql server 5.6\bin>mysql -u root -p

enter password: *********

mysql> show databases;

+--------------------+

| database |

+--------------------+

| information_schema |

| edu |

| guest |

| mysql |

| performance_schema |

| sakila |

+--------------------+

11 rows in set (0.01 sec)

***************=--進入資料庫

mysql> use edu;

database changed

********************建表

mysql> create table blog(

-> bid mediumint(8) primary key auto_increment,

-> btitle varchar(60) ,

-> content text,

-> status tinyint(2),

-> cid tinyint(4)

-> );

query ok, 0 rows affected (0.47 sec)

幾種建表的方法:

// 建表名為 blog_blog

create table blog_blog(

bid mediumint(8) primary key auto_increment,

btitle varchar(60) ,

content text,

status tinyint(2),

cid tinyint(4)

)//更改主鍵bid 為id

alter table blog_blog change bid id mediumint(8) auto_increment

// 建表名為 blog_channel

create table blog_channel(

cid tinyint(4) default null,

ctitle varchar(60) default null,

isshow tinyint(2) default '1'

)engine = myisam default charset = gbk

3樓:匿名使用者

create [temporary] table [if not exists] tbl_name [(create_definition,...)]

如何在命令列建立mysql資料庫

第一步 安裝mysql客戶端 當然你得確保mysql客戶端已經安裝完畢。如果沒有的話,可以按照下面的方法。在debian,ubuntu 或者 linux mint上 sudo apt get install mysql client sudo apt get install mysql 第二步 登陸...

AE如何在某個位置拉出文字,AE如何在某個位置拉出文字? 80

海灘的浪花化成雪 第一步 雙擊文字圖層,會顯示文字位置。第二步 單擊左上角類似滑鼠符號的圖示。如下圖,單擊滑鼠左鍵拖動就可以了 帕克園長 主要技術點是軌道遮罩。先建立好文字圖層,做好位置移動動畫 然後建立軌道遮罩圖層,確定文字出現的區域 在文字圖層右側選擇軌道遮罩。利用圖層蒙版也可以實現。這些都是a...

mysql資料庫查詢的問題,mysql 資料庫查詢的乙個問題

select from select t.num if category id t.category id,num 1,1 as cal rank,category id t.category id from select from goods order by category id asc go...