Home >Database >Mysql Tutorial >几条mysql命令

几条mysql命令

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 15:34:191106browse

Select * from dept order by deptno desc limit 3,2;-- 从第三条记录往后取两条记录 创建一个序列 Create table sequence( seqid int primary key auto_increment,--seqin 会自动递增 seqname varchar(15) ) 函数 : now() 取现在时间: select now(); date

Select * from dept order by deptno desc limit 3,2;--从第三条记录往后取两条记录

 

创建一个序列

Create table sequence(

       seqid int primary key auto_increment,--seqin会自动递增

       seqname varchar(15)

)

 

函数

now() –取现在时间:select now();

date_format()—时间函数:select date_format(now(),’%Y-%M-%D %H:%I:%S’)

                                          select date_format(now(),’%Y-%m-%d %H:%I:%S’)

 

 

导出数据库:

命令格式

mysqldump -u用户名 -p 数据库名 > 数据库名.sql

范例:

mysqldump –u root -p abc > abc.sql

(导出数据库abcabc.sql文件)

 

导入数据库:

命令格式

mysql -u用户名 -p 数据库名 数据库名.sql

范例:

mysql –u abc_f -p abc

(导入数据库abcabc.sql文件)

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn