mysql的CREATE TABLE IF NOT EXISTS 方法
2012-08-14 18:03
567 查看
DROP TABLE IF EXISTS `ci_sessions`;
CREATE TABLE IF NOT EXISTS `ci_sessions` (
`session_id` VARCHAR(40) NOT NULL DEFAULT '0',
`peopleid` INT(11) NOT NULL,
`ip_address` VARCHAR(16) NOT NULL DEFAULT '0',
`user_agent` VARCHAR(50) NOT NULL,
`last_activity` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`LEFT` INT(11) NOT NULL,
`name` VARCHAR(25) NOT NULL,
`status` TINYINT(4) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ci_sessions` (
`session_id` VARCHAR(40) NOT NULL DEFAULT '0',
`peopleid` INT(11) NOT NULL,
`ip_address` VARCHAR(16) NOT NULL DEFAULT '0',
`user_agent` VARCHAR(50) NOT NULL,
`last_activity` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`LEFT` INT(11) NOT NULL,
`name` VARCHAR(25) NOT NULL,
`status` TINYINT(4) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
相关文章推荐
- mysql的CREATE TABLE IF NOT EXISTS 方法
- Mysql官方文档中争对安全添加列的处理方法。Mysql Add a Column to a table if not exists
- MySQL对CREATE TABLE IF NOT EXISTS SELECT的处理
- # mysql CREATE TABLE IF NOT EXISTS metadata lock坑
- Mysql官方文档中争对安全添加列的处理方法。Mysql Add a Column to a table if not exists
- mysql insert if not exists防止插入重复记录的方法
- mysql5.7基础 create database if not exists... 判断数据库是否存在 若不存在则创建
- mysql insert if not exists防止插入重复记录的方法
- mysql insert if not exists防止插入重复记录的方法
- Android 判断SQLite数据库中是否存在某一个表格: CREATE TABLE IF NOT EXISTS
- mysql insert if not exists防止插入重复记录的方法(转)
- mysql insert if not exists防止插入重复记录的方法
- <3>createTableIfNotExist
- MySQL: mysql is not running but lock exists 的解决方法
- mysql防止重复插入相同记录 insert if not exists
- MySQL 当记录不存在时插入insert if not exists
- MySQL 当记录不存在时插入(insert if not exists)
- oracle不提供CREATE TABLE IF NOT EXIST方式创建表
- to create table if table do not exist -- to backup and restore table in oracle
- mysql的.sql文件头部 /*!32312 IF NOT EXISTS*/;