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! Quote Link to comment 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? Quote Link to comment 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). Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.