DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   what to do with this .SQL script? (http://www.daniweb.com/forums/thread18334.html)

kubota Feb 9th, 2005 4:38 pm
what to do with this .SQL script?
 
hi, in order to install my php gallery, i have to "Run the photos.sql script in your MySQL database" what does this mean? i know i have mysql, as i have a phpBB2 forum running. but how do i do this? thanks

Paul.Esson Feb 11th, 2005 5:34 am
Re: what to do with this .SQL script?
 
somthing like

 
mysql < photos.sql

should do the trick

kubota Feb 11th, 2005 3:54 pm
Re: what to do with this .SQL script?
 
??? but i wanted to know how to add it to my MySQL database :O

Paul.Esson Feb 14th, 2005 2:14 am
Re: what to do with this .SQL script?
 
mysql mydatabasesname < photos.sql

kubota Feb 14th, 2005 3:20 pm
Re: what to do with this .SQL script?
 
Quote:

Originally Posted by Paul.Esson
mysql mydatabasesname < photos.sql

errrr.....have you actually read my question, your an idiot or what, if ya not gonna help, fade away.......

Paul.Esson Feb 15th, 2005 11:22 am
Re: what to do with this .SQL script?
 
Well hmm, Yes I did, LETS say i have a database called test !! and a mysql script that looks like such

[root@Kat root]# cat pont.sql
#DROP TABLE `test`
#CREATE TABLE test(nick VARCHAR(30), about VARCHAR(30));

INSERT INTO test () VALUES ("Paul.Esson" , "Trying to be nice" );
INSERT INTO test () VALUES ("kubota" , "Idiot");
SELECT * FROM test

because I do, Now I wish to run this script
[root@Kat root]# mysql test < pont.sql
nick    about
Paul.Esson      Trying to be nice
kubota  Idiot
Paul.Esson      Trying to be nice
kubota  Idiot
Paul.Esson      Trying to be nice
kubota  Idiot
[root@Kat root]#

It works for me

You might try reading the man pages ?

[root@Kat root]# man mysql | tail -n 20 | head -n 5
EXAMPLE
      You can also read a backup dump file back into MySQL with:

      mysql  database < backup-file.sql

So basicly what you need to do is open up some kinda console
start > run > cmd

in windows

then you need to make certain that mysql is in your path, prolly easyest to change to the mySQL dir, then you type

mysql theDatabaseName < C:\path\to\the\file\photowhatever.sql

and pray it should hopfully work without a hitch.

Gary King Feb 21st, 2005 5:38 pm
Re: what to do with this .SQL script?
 
Do you have phpMyAdmin installed? If not, then INSTALL IT. It's the best way to work with MySQL for dummies (even experts use it, very easy to use.) I'm sure you already have it installed on your webhost, though. Then just import the file in phpMyAdmin.


All times are GMT -4. The time now is 7:42 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC