To perform batch conversion or call conversion procedure from an automation script you can use console version of MSSQL-to-MySQL called M2SAGENT.EXE. Find this file in MSSQL-to-MySQL installation folder. You can either run this tool directly from command line or call it from any script as well. The program supports the following command-line options:
| --as_dbo | connect as database owner | ||
| --dest=... | MySQL database or dump file name | ||
| --dump | convert MS SQL database into dump file | ||
| --help | display help message and exit | ||
| --logfile=... | path to the logfile where execution traces will be written | ||
| --mode=... | how to process an existing MySQL database (0 - overwrite the entire database, 1 - overwrite existing tables only, 2 - skip existing tables, 3 - merge) | ||
| --mssqlh=... | MS SQL server IP address or network name | ||
| --mssqlu=... | MS SQL user name | ||
| --mssqlp=... | MS SQL user password | ||
| --mysqlh=... | MySQL server IP address or network name | ||
| --mysqlu=... | MySQL user name | ||
| --mysqlp=... | MySQL user password | ||
| --port=... | MySQL port | ||
| --silent | use this option to disable program output | ||
| --skip_idx | skip converting indexes | ||
| --src=... | MS SQL database name | ||
| --tab_def | convert table definitions only | ||
| --tab_file=... | name of the file containing table names to convert (one table name per line) |
In the following example the program converts local MS SQL database "db1" into MySQL database "db1 from mssql" on the remote MySQL server "mysqlhost" using table names file "c:\tabfile1.txt":
M2SAGENT.EXE --src=db1 --dest="db1 from mssql" --mysqlh=mysqlhost --mysqlu=administrator --mysqlp=the_passsword --tab_file=c:\tabfile1.txt
Table names file should be formatted as follows:
Table_1
Table_2
...
Table_N
Notes:
- You can omit 'mssqlh' or 'mysqlh' to connect local database server
- You can omit 'mssqlu' and 'mssqlp' parameters to connect to MS SQL server using Windows authentication
- It is necessary to specify 'port' parameter only if it deffers from the default MySQL port 3306
- If you omit 'tab_file' parameter, all database tables will be converted
- If you omit 'mode' parameter, default mode 'overwrite the entire database' will be used
- Command line parameters that contain spaces should be enclosed in quotes (for example --dest="my database")
Tags:
| configure: error: Cannot find libmysqlclient_r under /usr/local/mysql< Prev | Next >Allowed memory size of 134217728 bytes exhausted |
|---|


