MySQL导出导入命令的用例
2008-10-20 11:11:35 来源:WEB开发网Enter password:
C:MySQLMySQL Server 5.0bin>
testdb.sql内容如下:
-- MySQL dump 10.10
--
-- Host: localhost Database: testdb
-- ------------------------------------------------------
-- Server version 5.0.7-beta-nt
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO__ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`userid` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(50) NOT NULL,
`email` varchar(50) default NULL,
PRIMARY KEY (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `user`
--
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
LOCK TABLES `user` WRITE;
INSERT INTO `user` S (1,'aaa','aaa','aaaa'),(2,'bbb','bbbb','bbbb@sina.com');
UNLOCK TABLES;
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
--
-- Table structure for table `user1`
--
DROP TABLE IF EXISTS `user1`;
CREATE TABLE `user1` (
`userid` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(50) NOT NULL,
`email` varchar(50) default NULL,
PRIMARY KEY (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `user1`
--
/*!40000 ALTER TABLE `user1` DISABLE KEYS */;
LOCK TABLES `user1` WRITE;
INSERT INTO `user1` S (1,'cccc','cccc','cccc'),(2,'cccc','cccc','cccc@sina.com');
UNLOCK TABLES;
/*!40000 ALTER TABLE `user1` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE*/;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS*/;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS*/;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT*/;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS*/;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION*/;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES*/;
更多精彩
赞助商链接