CentOS MySQL Batch run SQL - mysql

This may have been answered elsewhere, but I can't seem to locate it, so please accept my sincere apologies if this is a duplicate question.
Complete newbie to CentOS command line operation of MySQL.
I'm trying to migrate 200,000,000 + records from a MSSQL database to MySQL and the Workbench migration tool fails. Given up trying to sort that so I've written a migration package in VB.Net to get all of the other 7-800 tables migrated directly, and they work great, but I have a few very large tables with around 15,000,000 records or more in each and my migration method would take several days to complete!
So - brainwave... I have the migration program create "insert into..." SQL statements in a single sql file, ftp this to my CentOS box and execute it locally on the CentOS machine.
Works fine, using:
mysql --user=user --password=password
to log in to MySQL, then executing the script as
source mysqlscript.sql
...but I will have a lot of scripts, such as
script1.sql
script2.sql
script3.sql
...
script27.sql
Is there a way within MySQL to batch process all these SQL scripts so I can just leave it running without having to manually set each of the 27 scripts off manually?

Related

MySQL Workbench not allowing me to run query

So I installed mysql and mysql workbench now my goal is to run 20 different queries on the schema and database I installed onto it. to install the schema and database I used File => Open Sql Script and then selected the schema then the database to install them. However I seem to have a issue where the lightning bolt icon you use to run scripts isn't high lighted and it's not allowing me to run anything and I don't know why.

Why do all my procedures run when I import mysqldump file?

I execute the following statement from the cmd terminal to import my MySQL Database:
mysql u- root p- database < "C:\Users\Tom\data.sql"
When I open my MySQL Database from the MySQL Workbench I've realised that more tables have been created that I don't recognise. Basically, what is happening is the stored procedures/routines I have created seem to be automatically running and thus creating many more tables? I don't want this, I'd rather execute routines as I wish using the "Call" statements in MySQL, is there a way stop this happening?

Installing (minimal) MySQL Workbench to simply join data from two .csv files (connections???)

I previously used MySQL Workbench to do this, in an environment that was already set up.
How do I set up a minimal working environment to just create and join tables on my own computer? (Connections???)
More details:
I downloaded and installed MySQL Workbench, and I can't even run SELECT sysdate();. There's a red x next to it. If I try "CREATE DATABASE MY_DATABASE; there's a green check, but the execute button is grey.
Doing some reading I apparently need "connections." Reading about that, I apparently need to also install MySQL Database Server. Who knows what else.
So, again, the question is how do I set up a minimally working environment to just create tables from .csv files, join them with MySQL commands, and export the results to another .csv file? (I know the syntax of the command to import a .csv file, and how to join tables.)
Thanks.
Install MySQL WorkBench AND MySQL Server.
From the command line, in the directory where MySQL server is installed, execute "mysqld --initialize" (One time only.)
execute "mysqld" from the command line, after the initialization given in step 1, and after any reboots. (It runs in the background, and doesn't exit when you exit MySQL WorkBench. (It can optionally be installed as an automatically running Windows service during installation.)
Execute Database -> Connect to Database upon starting MySQL WorkBench (each time you start the application). The default local host connection works fine.
After doing File -> New Model and setting up table(s), do Database -> Forward Engineer. This will place your new database in the Schemas section on the home/main window.
Double click on the Schema you created (default name is mydb) and it changes to bold font. Now scripts you run from that main window will run against the database you created.

Convert mysql database to sqlite database using shell script

I have shell script. I want to convert mysql database to sqlite database.
I want to install cygwin.
Can anybody help in getting what packages i need to install ?
I tries a lot's but if i select all then it takes whole day and nothing happen or sometime it breaks installation.

Can we generate mysql database in perl without connecting to server?

Recently i came across a tool written in tcl which generates a mysql database without connecting to a server. It uses some c libraries, can this be done in perl? Sorry if this is too basic question. This is completely new to me, couldnt find much information.
EDIT:
By "generates a mysql database" i mean it generates a directory with mysql tables. I can create a soft link to that directory in mysql and query data from that
You can generate an SQL file maually that builds up a database when imported into a mysql database. I would advise against manyually creating binary tables and copying them under mysql's data folder.
On the other hand if you want to use SQL databases locally, without having to run a separate server process try SQLite.