jimath Posted October 3, 2006 Share Posted October 3, 2006 hi everone!could anyone tell me how i can import a txt file with sql commandsfrom the mysql command line?the following doesnt help me.mysqladmin create nukemysql nuke<nuke.sqli 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! Link to comment https://forums.phpfreaks.com/topic/22891-import-a-txt-file-from-the-command-line/ Share on other sites More sharing options...
effigy Posted October 3, 2006 Share Posted October 3, 2006 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? Link to comment https://forums.phpfreaks.com/topic/22891-import-a-txt-file-from-the-command-line/#findComment-103212 Share on other sites More sharing options...
jimath Posted October 3, 2006 Author Share Posted October 3, 2006 i write thismysql> mysql -p nuke <C:\Program Files\Apache Group\Apache2\htdocs\PHP-Nuke-7.8\sql\nuke.sqland its displayed the -> arrow. i have created the database (nuke). Link to comment https://forums.phpfreaks.com/topic/22891-import-a-txt-file-from-the-command-line/#findComment-103229 Share on other sites More sharing options...
effigy Posted October 3, 2006 Share Posted October 3, 2006 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. Link to comment https://forums.phpfreaks.com/topic/22891-import-a-txt-file-from-the-command-line/#findComment-103259 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.