• Increase font size
  • Default font size
  • Decrease font size
Tag:command line

 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:

  1. You can omit 'mssqlh' or 'mysqlh' to connect local database server
  2. You can omit 'mssqlu' and 'mssqlp' parameters to connect to MS SQL server using Windows authentication
  3. It is necessary to specify 'port' parameter only if it deffers from the default MySQL port 3306
  4. If you omit 'tab_file' parameter, all database tables will be converted
  5. If you omit 'mode' parameter, default mode 'overwrite the entire database' will be used
  6. Command line parameters that contain spaces should be enclosed in quotes (for example --dest="my database") 
 

 The most basic operation a download manager needs to perform is to download a file from a URL. Here’s how you would use wget to download a file:

 
# wget http://www.google.com/index.html
 
wget
 
 #uname -a

Linux HCMRTG_BY_YaoBin 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386 GNU/Linux

 

[root@]# cat /proc/version

Linux version 2.6.18-92.el5 (brewbuilder@hs20-bc2-3.build.redhat.com) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-41)) #1 SMP Tue Apr 29 13:16:12 EDT 2008

 

 

 Activate network interface eth0 with a new IP (172.168.10.50) / netmask:
$ sudo ifconfig eth0 172.168.10.50 netmask 255.255.255.0 up