Let's say I have a .TXT file that issues various mysqldump commands. How can I run this from the Linux command prompt like a .BAT file?
Thanks in advance.
This is a discussion on executing script file from Linux command prompt in the Open Discussion & Chit-chat forum
Let's say I have a .TXT file that issues various mysqldump commands. How can I run this from the Linux command prompt like a .BAT ...
Let's say I have a .TXT file that issues various mysqldump commands. How can I run this from the Linux command prompt like a .BAT file?
Thanks in advance.
Are those actual my sql commands (as you would type them at the command line with the 'mysql' command included), or are they just SQL statements? If they are only the SQL statements, "SELECT FROM" or "INSERT INTO" for example, then you can upload the file into phpMyAdmin. If it contains the mysql command as you would type them into the command line, you can use this command:
bash textfile.txt
or you can add
#!/bin/bash
as the first line of the file and then chmod it to 700 to make it executable. They just type
./textfile.txt
and it will run as a script.
--Jason
Thanks. It's that bash thing that I have to remember.
Copyright © 2011 JaguarPC.com
Bookmarks