How to Run MySQL Scripts To Create Data Tables
Another common feature of prepackaged applications written in MySQL is that they may require you to not only create the database, but also to create the tables of data inside them as part of the setup procedure. Fortunately, many of these applications come with scripts you can use to create the data tables automatically.
Usually you have to run the script by logging into MySQL as the MySQL root user and automatically importing all the script file’s commands with a < on the command line.
The example runs a script named create_mysql.script whose commands are applied to the newly created database named salesdata. MySQL prompts for the MySQL root password before completing the transaction. (You have to create the database first, before you can run this command successfully.)
[root@bigboy tmp]# mysql -u root -p salesdata < create_mysql.script Enter password: [root@bigboy tmp]#
Latest posts by Editor (see all)
- How to Show files by size, biggest last- Linux Commands - January 21, 2011
- How to test for unreadable blocks on disk- Linux Commands - January 21, 2011
- How to Do a read speed test on disk sda – Linux Commands - January 21, 2011