Moving MySql from windows server to linux -


moving old win2003 server new vm server (our choice win or linux) if go linux there problems converting current tables?

moving mysql/windows same version of mysql/linux

you can mysqldump databases follows:

c:\> mysqldump -uroot -p --routines --triggers --flush-privileges --all-databases > mysqldata.sql 

move mysqldata.sql linux box , run reload

mysql -uroot -p < mysqldata.sql 

moving mysql/windows higher version of mysql/linux

you can mysqldump databases except mysql schema !!! why?

here windows batch script mysqldump databases except mysql schema , dump mysql schema in pure sql:

rem rem startup settings rem set mysql_conn=-uroot -prootpassword set mysqldump_output=c:\localdump.sql set mysql_usergrants=c:\localgrants.sql set mysql_tempgrants=c:\tempgrants.sql rem rem mysql user data rem set mysqldump_options=--routines --triggers --databases set sqlstmt=select concat('mysqldump %mysql_conn% %mysqldump_options% ',dblist) set sqlstmt=%sqlstmt% (select group_concat(schema_name separator ' ') dblist set sqlstmt=%sqlstmt% information_schema.schemata schema_name not in set sqlstmt=%sqlstmt% ('information_schema','mysql','performance_schema')) echo echo off > c:\runlocaldump.bat mysql %mysql_conn% -ane"%sqlstmt%" >> c:\runlocaldump.bat c:\runlocaldump.bat > %mysqldump_output% rem rem mysql user grants rem set sqlstmt=select concat('show grants ''',user,'''@''',host,''';') set sqlstmt=%sqlstmt% mysql.user length(user) echo %sqlstmt% mysql %mysql_conn% -ane"%sqlstmt%" > %mysql_tempgrants% mysql %mysql_conn% -an < %mysql_tempgrants% > %mysql_usergrants% del %mysql_tempgrants% 

once create mysqldump , grants file, copy them linux server execute them locally. execute mysqldump first. then, load grants.

give try !!!


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -