Mysql

MySQL技术手册要点解析-2

13.mysql有些命令是oracle里面没有的,而且这些show命令也不同于sqlplus里面的,这里的show都必须要有分号结尾。

SHOW TABLES;

SHOW DATABASES;

desc table_name;

14.mysql 导入load datainfile其实类似于oracle的sqlloader,也有行分隔、列分隔、可以指定字符集

LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet LINES TERMINATED BY '\r\n';

 load data infile '/tmp/t0.txt' into table t0 character set gbk fields terminated by ',' enclosed by '"' lines terminated by '\n' (`name`,`age`,`description`) set update_time=current_timestamp;

 

关键词: 

MySQL技术手册要点解析-1

1.mysql为了可以兼容各种产品级别的主流数据库,设置了这个sql_mode 参数,比如为了兼容oracle,可以设置为sql_mode=oracle,为了兼容db2可以设置为sql_mode=db2等等...,这个参数可以在msqld启动时候加上,也可以在运行时,修改全局或者session的参数

1.8.2. Selecting SQL Modes
The MySQL server can operate in different SQL modes, and can apply these modes differentially for different clients. This capability
enables each application to tailor the server's operating mode to its own requirements.
SQL modes control aspects of server operation such as what SQL syntax MySQL should support and what kind of data validation

关键词: