Mysql一些导入导出数据库,添加修改字段命令
生活随笔
收集整理的這篇文章主要介紹了
Mysql一些导入导出数据库,添加修改字段命令
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Mysql 導(dǎo)出數(shù)據(jù)庫表包含數(shù)據(jù)命令:
mysqldump -uroot -proot abc >/var/abc.sql;
(mysql用戶名:root??? 密碼 root??? 數(shù)據(jù)庫:abc???? 導(dǎo)出到:/var/abc.sql)
Mysql 導(dǎo)出數(shù)據(jù)庫表不包含數(shù)據(jù)命令:
mysqldump -uroot -proot -d abc >/var/abc.sql;
?Mysql導(dǎo)入表和數(shù)據(jù):
use abc;source /var/abc.sql;(選擇abc數(shù)據(jù)庫,需要導(dǎo)入的文件是:/var/abc.sql)
Mysql添加字段:
alter table table1 add name varchar(10) not Null; //為table1表添加一個(gè)name字段,字段的類型為varchar(10) alter table table1 add sid int not Null auto_increment primary key //w為table1表添加一個(gè)自增逐漸Mysql修改命令:
alter table table1 change name name1 varchar(20) not Null; //修改表table1 把table1中的name字段修改name1,類型修改為varchar(20) 不為空?學(xué)習(xí)在于一滴一滴積累!
@author:spring sky
Email :vipa1888@163.com
QQ:840950105
轉(zhuǎn)載于:https://www.cnblogs.com/springskyhome/archive/2011/12/08/3689946.html
總結(jié)
以上是生活随笔為你收集整理的Mysql一些导入导出数据库,添加修改字段命令的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 当excel 导入数据库的字段大于255
- 下一篇: c#泛型浅见