Insert into qhs_timeline(time,info,detail) select time,info,detail from qhs_timeline;
三、 show create table eye_21.order_func
describe table eye_21.order_func
四、建表语句
建表语句
CREATE TABLE `en_orders_93` (
`Id` bigint(20) NOT NULL AUTO_INCREMENT,
`parentId` bigint(20) DEFAULT NULL, `
orderType` int(11) DEFAULT NULL,
`createDate` datetime DEFAULT NULL,
`completeDate` datetime DEFAULT NULL,
`state` int(11) DEFAULT NULL, `yn` tinyint(3) DEFAULT NULL, `splitType` int(11) DEFAULT NULL, `sendPay` varchar(800) DEFAULT NULL, `pin` varchar(300) DEFAULT NULL COMMENT 'pin', `customerName` varchar(300) DEFAULT NULL COMMENT 'customerName', `mobile` varchar(50) DEFAULT NULL, `phone` varchar(50) DEFAULT NULL, `customerEmail` varchar(100) DEFAULT NULL, `paymentType` int(11) DEFAULT NULL, `shipmentType` int(11) DEFAULT NULL, `zip` varchar(50) DEFAULT NULL, `province` int(11) DEFAULT NULL, `city` int(11) DEFAULT NULL, `county` int(11) DEFAULT NULL, `town` int(11) DEFAULT NULL, `address` varchar(2000) DEFAULT NULL COMMENT 'address', `expectPickDate` datetime DEFAULT NULL, `userLevel` varchar(255) DEFAULT NULL, `customerIp` varchar(100) DEFAULT NULL, `partnerId` int(11) DEFAULT NULL, `remark` text,
`weight` decimal(18,4) DEFAULT NULL,
`volume` decimal(18,4) DEFAULT NULL,
PRIMARY KEY (`Id`) ) ENGINE=InnoDB
AUTO_INCREMENT=22373470
DEFAULT CHARSET=utf8
COMMENT='国际站订单详情表'
四
1:mysql导出数据库成为sql文件
mysqldump --opt --user=$dbuser --password=$dbpass --host=$dbhost $dbname > ~/backups/$sitename/$dbname.sql
2:导入数据库sql脚本
source D:\$dbname.sql
3:新建用户
GRANT ALL PRIVILEGES ON *.* TO cactiuser@'%' IDENTIFIED BY 'CactiMadeEZ';
drop user work@'%';
创建用户
GRANT ALL PRIVILEGES ON *.* TO cactiuser@'%' IDENTIFIED BY 'CactiMadeEZ';
drop user work@'%' 删除远程用户
关闭服务:
mysqladmin -u root -p root shutdown 关闭服务 启动服务:mysqld -uroot 或者mysqld --standalone --debug
命令:
在命令行中如果出现乱码:set names gbk
DESC 表名 查看表结构
外键:
1:1005错误的原因出现,大多数情况为,当前的外键
mysql: 的要求:作为外键的那列必须有一个索引(index) 否则就会出现建表不成功的情况。
:外键命名每个标的外键的名字必须不一样,否则也会出现1005错误,命名规则为:fk_当前表_目标表