Have you tried running this from the mysql monitor? -----Original Message----- From: Andre MATOS To: Victor Pendleton Cc: '[EMAIL PROTECTED] ' Sent: 7/8/04 5:33 PM Subject: RE: Scripts - ERROR
Hi, I tried but didn't work. Here is my script: # ------------------------------------------------------------------------ # @Name : NTT_dbcreator.2004-06-07.v1-001.andre.sql # @DESCRIPTION : NTT Database Creator # @CREATED : Jun 07, 2004 by Andre Matos - [EMAIL PROTECTED] # @VERSION : 1.01 # ------------------------------------------------------------------------ SET FOREIGN_KEY_CHECKS=0; DROP DATABASE IF EXISTS `database1`; CREATE DATABASE `database1`; commit; SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql; commit; DROP DATABASE IF EXISTS `database2`; CREATE DATABASE `database2`; commit; SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql; commit; DROP DATABASE IF EXISTS `database3`; CREATE DATABASE `database3`; commit; SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql; commit; DROP DATABASE IF EXISTS `database4`; CREATE DATABASE `database4`; commit; SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql; commit; DROP DATABASE IF EXISTS `database5`; CREATE DATABASE `database5`; commit; SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql; commit; DROP DATABASE IF EXISTS `database6`; CREATE DATABASE `database6`; commit; SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql; commit; SET FOREIGN_KEY_CHECKS=0; # end of the script NB: "ntt_dbcreator.2004-06-07.v1-001.andre.sql" is another script that is responsable for creating the tables, indexes, relations, etc... This is the error when I tried to run the main script using phpMyAdmim: Database mysql running on localhost Error SQL-query : SOURCE ntt_dbcreator.2004 -06 - 07.v1 - 001.andre.sql MySQL said: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql' at line 1 Thanks. Andre On Thu, 8 Jul 2004, Victor Pendleton wrote: > Have you tried writing the script using the source command? > drop database; > create database; > source populate_db; > .... > > -----Original Message----- > From: Andre MATOS > To: [EMAIL PROTECTED] > Sent: 7/8/04 12:20 PM > Subject: Scripts > > Hi List, > > Let's suppose that I have a script to create one database (tables, > indexes, etc). > > How can I call another script from this script? For example: > > DROP DATABASE test; > CREATE DATABASE test; > > (here call another script) > > back to the previous script > > > > Thanks. > > Andre > > -- Andre Matos [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]