tags:

views:

135

answers:

3

i have about 8mb of sql code i need to run. it looks like this:

/*
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

how do i run it on http://www.wampserver.com/en/download.php

+4  A: 

see Executing SQL Statements from a Text File

longneck
+1  A: 

Presuming that WAMP means Windows, Apache, MySQL, Perl/Php, you would use the MySQL command line client to apply the SQL script.

The process is documented here: http://dev.mysql.com/doc/refma/5.1/en/batch-commands.html

If Wampserver installs MySQL in the normal place, the mysql client will be found somewhere such as C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql .

Joe Koberg
hold on joe and longneck, i want to only use wamp to do this. i dont want to download mysql yet. im just a beginner. unless you want to explain to me how i can connect mysql to wamp
I__
the M in wamp is Mysql. no mysql, no wamp.
Byron Whitlock
http://www.wampserver.com/en/download.php
I__
sooo, what is that link for? wampserver includes "MySQL 5.1.36".
Byron Whitlock
wampserver is just on c:\wamp, what should i do to get this code rnuning?
I__
+1  A: 

Find the mysql.exe in your wamp installation, then run

 mysql.exe -u username -p password database < textfile.sql
Byron Whitlock
can you give me an example? it doesnt wokr fo rme
I__
You are using the command line right?Did you replace "username" with your mysql username? Did you replace "password" with your mysql password?Did you replace "textfile.sql" with your 8mb sql file?What isn't working? what error are you getting?
Byron Whitlock
Oh yeah, make sure you replace database with the name of the mysql database you want to import into.
Byron Whitlock