MySQL基础知识

时间:2014-07-22 22:53:56   收藏:0   阅读:274

导出数据

mysqldump --opt -hlocalhost -uusername -ppassword --skip-lock-tables databasename>database.sql    

导入数据

mysql> source 路径\**.sql

创建中文名称数据库

mysql> set names gbk;
mysql> create database 中文;

查看版本

mysql -u root -p -e "select version()"

表格

查询表记录数

select count(*) from tablename;

删除表格

drop table tablename;

查询表某几行

select * from table limit 5,10;     检索记录行6-15
select * from table limit 95,-1;    检索记录行96-last
select * from table limit 5;        检索前5个记录行    

删除前几行

delete from table tablename limit 5;    删除前5个记录行

MySQL基础知识,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!