ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Creating an empty MySQL db from within a batch script

(1/1)

questorfla:
I once had this working but I have misplaced the exact procedure.  It was a short one or two line sequence that ran at the front of an install script that created an empty database ready to be loaded.
 
The first line allowed input of the DB name and the second created the empty DB inside the correct folder.  The only prerequisite is the collation format is preferred to use Latin1_swedish_ci.  The rest of the field loading and parameters is done later in the script but it assumes the empty DB is already there. 

It is a lot faster to do during the creation script than to use PHPMyAdmin or similar to create the DB then exiting to run the other script to load the tables.
Unfortunately, I have not used this is a couple years and do not remember the exact sequence to get it to work but I do remember it took quite a while to find the right setup to run from inside a batch file even though the task itself is rather simple.

4wd:
Shades answered this on one of your previous quests, his command file has the commands to create a database.

Navigation

[0] Message Index

Go to full version