Jump to content

Archived

This topic is now archived and is closed to further replies.

jimath

import a txt file from the command line

Recommended Posts

hi everone!

could anyone tell me how i can import a txt file with sql commands
from the mysql command line?
the following doesnt help me.
mysqladmin create nuke
mysql nuke<nuke.sql

i have the txt file in a folder into htdocs and i want to run it.
i am already connected to mysql as root.
mysql>
thanks!

Share this post


Link to post
Share on other sites
Try[tt] mysql [i]database[/i] < [i]/full/path/to/file[/i][/tt]. You may also need to specify the[tt] -p [/tt] option if it is not on by default in your configuration file: [tt] mysql -p [i]database[/i] < [i]/full/path/to/file[/i][/tt]. What error messages are you getting?

Share this post


Link to post
Share on other sites
i write this
mysql> mysql -p nuke <C:\Program Files\Apache Group\Apache2\htdocs\PHP-Nuke-7.8\sql\nuke.sql

and its displayed the -> arrow.
i have created the database (nuke).

Share this post


Link to post
Share on other sites
Ah. I was thinking the OS's command line, not MySQL's (I see you specified that). From the MySQL command line you can use[tt] \. [i]file[/i][/tt] or[tt] source [i]file[/i][/tt]. Use[tt] \h [/tt]to see what else you can do.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.