Re: [PHP] Miguel...
by Miguel Cruz other posts by this author
Apr 5 2002 5:55PM messages near this date
[PHP] Miguel...
|
[PHP] Directory to array to select box...
On Fri, 5 Apr 2002, Anthony Ritter wrote:
> Now I have a .txt file of my sql statement.
>
> > As others have suggested, you can use phpmyadmin to import this file, or
> > you can just pipe it into the mysql command-line tool on the server once
> > you've created your database. Look inside the file created by mysqldump
> > and all will be much clearer.
>
> I take that to mean (the ISP's remote server where my website resides).
> Right?
>
> How can I get the compete mysql statement onto the ISP's server?
If you have shell access on your ISP's server, the quickest way to get
that data into the database there is to copy the file across (using FTP or
scp or whatever you use) and then pipe it straight in. Assuming that the
mysqldump file is called 'data.txt', your database name is 'my_database'
and your database username is 'me', you could use a command like this:
mysql -p -u me my_database < data.txt
It'll ask for your password and then the data will be in.
If you don't have command-line access, you could use a tool like
phpmyadmin, which your ISP may provide. It has an option to import data
from a mysqldump file.
Worst comes to worst, you can write a quick PHP script that reads each
line of the .txt file and sends it to mysql_query. Just skip blank lines
and comments (lines starting with #).
miguel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Anthony Ritter
Miguel Cruz
|