1

我有大约 8mb 的 sql 代码需要运行。它看起来像这样:

/*
MySQL Data Transfer
Source Host: 10.0.0.5
Source Database: jnetdata
Target Host: 10.0.0.5
Target Database: jnetdata
Date: 5/26/2009 12:27:33 PM
*/

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for chavrusas
-- ----------------------------
CREATE TABLE `chavrusas` (
  `id` int(11) NOT NULL auto_increment,
  `date_created` datetime default NULL,
  `luser_id` int(11) default NULL,
  `ruser_id` int(11) default NULL,
  `luser_type` varchar(50) default NULL,
  `ruser_type` varchar(50) default NULL,
  `SessionDay` varchar(250) default NULL,
  `SessionTime` datetime default NULL,
  `WeeklyReminder` tinyint(1) NOT NULL default '0',
  `reminder_phone` tinyint(1) NOT NULL default '0',
  `calling_card` varchar(50) default NULL,
  `active` tinyint(1) NOT NULL default '0',
  `notes` mediumtext,
  `ended` tinyint(1) NOT NULL default '0',
  `end_date` datetime default NULL,
  `initiated_by_student` tinyint(1) NOT NULL default '0',
  `initiated_by_volunteer` tinyint(1) NOT NULL default '0',
  `student_general_reason` varchar(50) default NULL,
  `volunteer_general_reason` varchar(50) default NULL,
  `student_reason` varchar(250) default NULL,
  `volunteer_reason` varchar(250) default NULL,
  `student_nli` tinyint(1) NOT NULL default '0',
  `volunteer_nli` tinyint(1) NOT NULL default '0',
  `jnet_initiated` tinyint(1) default '0',
  `belongs_to` varchar(50) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5913 DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for tbluseravailability
-- ----------------------------
CREATE TABLE `tbluseravailability` (
  `availability_id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `weekday_id` int(11) NOT NULL,
  `timeslot_id` int(11) NOT NULL,
  PRIMARY KEY  (`availability_id`)
) ENGINE=MyISAM AUTO_INCREMENT=10865 DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for tblusers
-- ----------------------------
CREATE TABLE `tblusers` (
  `id` int(11) NOT NULL auto_increment,
  `

ETC

我如何在http://www.wampserver.com/en/download.php上运行它

4

3 回答 3

4

请参阅从文本文件执行 SQL 语句

于 2009-08-28T20:40:19.030 回答
1

假设 WAMP 表示 Windows、Apache、MySQL、Perl/Php,您将使用 MySQL 命令行客户端应用 SQL 脚本。

该过程记录在这里:https ://dev.mysql.com/doc/refman/5.7/en/mysql-batch-commands.html

如果 Wampserver 在正常的地方安装 MySQL,mysql客户端会在某个地方找到,例如C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.

于 2009-08-28T20:40:50.417 回答
1

在 wamp 安装中找到 mysql.exe,然后运行

 mysql.exe -u username -p password database < textfile.sql
于 2009-08-28T20:55:53.570 回答