MySQL Migration ToolkitµÄʹÓÃ
MySQL Migration ToolkitÊÇMySQL³öµÄÊý¾ÝǨÒƹ¤¾ß(ÊÊÓÃÓÚMySQL5.0»òÒÔÉÏ)£¬Ê¹Óò¢²»¸´ÔÓ£¬Ö§³ÖOracle,Microsoft SQL Server,Microsoft Access,Sybase,MaxDBµ½MySQLÖ®¼äµÄת»»¡£ÒÔÏÂʵÀýÊÇOracleµ½MySQLµÄ¡£
1. °²×°jdk1.6
×°ÍêMySQL Migration Toolkit»¹Ðè°²×°jdk1.6£¬ÐèÒªjre1.5.0.8ÒÔÉϵÄÖ§³Ö¡£
2. ÔËÐÐMySQL Migration Toolkit
µã»÷“¿ªÊ¼”£“³ÌÐò”£“MySQL”£“MySQL Migration Toolkit”£¬ÔËÐÐMySQL Migration Toolkit¡£µã»÷“Next”
3. Ñ¡Ôñ“Direct Migration”£¬µã»÷“Next”
µÚÒ»´ÎÔËÐУ¬»á¸æËßÄãOracleµÄJDBC Driverδ¼ÓÔØ£¬ÏȼÓÔØojdbc14.jar¼´¿É¡£
4. ÔÚ“Source Database”ÖÐÌîдԴÊý¾Ý¿âµÄһЩ²ÎÊý
“Database System”ΪÊý¾Ý¿âϵͳÀàÐÍ£»
“Driver”ΪʹÓõÄÇý¶¯³ÌÐò£»
“Service”ΪԴÊý¾Ý¿âµÄ·þÎñÃû£»
“Hostname”ΪԴÊý¾Ý¿âÎļþµÄipºÍport£»
“Uesrname”ΪԴÊý¾Ý¿âµÄʹÓÃÓû§Ãû£»
“Password”ΪԴÊý¾Ý¿âʹÓÃÓû§ÃÜÂë¡£
5. ÔÚ“Target Database”ÖÐÌîдĿ±êÊý¾Ý¿âµÄһЩ²ÎÊý
“Database System”Êý¾Ý¿âϵͳÊÇMySQL Server£»
“Hostname”ΪÖ÷»úÃû³Æ£¬“Port”Ϊ¶Ë¿Ú£»
“Username”ΪÊý¾Ý¿âʹÓÃÕßÃû³Æ£»
“Password”ΪÊý¾Ý¿âʹÓÃÓû§ÃÜÂë¡£
6. Á½¸öÊý¾Ý¿âµÄ²ÎÊý¶¼ÌîдÍê³Éºó£¬ÏÂÃæÒ»²½¾ÍÊÇ·þÎñÆ÷µÄÁ¬½Ó
³öÏÖ“Execution completed successfully”¾Í˵Ã÷·þÎñÆ÷Á¬½Ó³É¹¦£¬Ö®ºóµã»÷“Next”¡£
7. Ñ¡ÔñҪת»»µÄÊý¾Ý¿â
Ñ¡ÔñÎÒÃÇÐèҪת»»µÄOracle Schema¡£
Ïà¹ØÎĵµ£º
ÐÞ¸Älinux·þÎñÆ÷µÄhttpÅäÖÃÖ®ºó£¬±ØÐëÖØÆôApache·þÎñ£¬ÃüÁîΪ£º /etc/rc.d/init.d/httpd restart
chown -R mysql:mysql Ŀ¼Ãû ¸Ä±äÎļþÊôÐÔ
mysqladmin -u root -p password 'new password' ÉèÖÃÃÜÂë
apt-get remove ɾ³ýÈí¼þ
apt-get clean ÇåÀí
/etc/rc.d/init.d/mysqld restart
php ¾ÍÅäÖÃÁËsession Ö÷ ......
±³¾°£ºÄ³¸öϵͳµÄmysqlÊý¾Ý¿âdnname²ÉÓÃĬÈϵÄlatin1×Ö·û¼¯£¬ÏµÍ³Éý¼¶ÐèÒª½«ËùÓÐÊý¾Ýת»»³Éutf-8¸ñʽ£¬Ä¿±êÊý¾Ý¿âΪnewdbname(½¨¿âʱʹÓÃutf8)
·½·¨Ò»£º
²½ÖèÒ» ÃüÁîÐÐÖ´ÐУºmysqldump --opt -hlocalhost -uroot -p*** --default-character-set=lantin1 dbname > /usr/local/dbname.sql
²½Öè¶þ ½« dbname.s ......
9.3. Óû§±äÁ¿
¿ÉÒÔÏÈÔÚÓû§±äÁ¿Öб£´æֵȻºóÔÚÒÔºóÒýÓÃËü£»ÕâÑù¿ÉÒÔ½«Öµ´ÓÒ»¸öÓï¾ä´«µÝµ½ÁíÒ»¸öÓï¾ä¡£Óû§±äÁ¿ÓëÁ¬½ÓÓйØ
¡£Ò²¾ÍÊÇ˵£¬Ò»¸ö¿Í»§¶Ë¶¨ÒåµÄ±äÁ¿²»Äܱ»ÆäËü¿Í»§¶Ë¿´µ½»òʹÓᣵ±¿Í»§¶ËÍ˳öʱ£¬¸Ã¿Í»§¶ËÁ¬½ÓµÄËùÓбäÁ¿½«×Ô¶¯ÊÍ·Å¡£
Óû§±äÁ¿µÄÐÎʽΪ@var_name
£¬ÆäÖбäÁ¿Ãûvar_name
¿ÉÒÔÓɵ±Ç°×Ö· ......
Ò»¸ö¼òµ¥Ê¾Àý--
1£¬×¼±¸£ºMySQLÊý¾Ý¿âÇý¶¯°ü¡¾mysql-connector-java-5.1.10-bin.jar¡¿µ¼Èë
2£¬´´½¨²âÊÔÁ¬½ÓÖ÷³ÌÐò
package mysqlConnection;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class JdbcDemo {
public static void main(String[] args) {
......
ÏîÄ¿Òª½áÊøÁË...ÖÁÉÙ¿ª·¢Òª½áÊøÁË...
»ØÍ·¿´¿´×Ô¼º¾ÍÕâôһ¸öÈËÂñÍ·¿ª·¢ÁË4¸öÔ£¬ÒÔ¼°ÊÖÉÏÄõ½µÄÓë×Ô¼º¸¶³öÍêÈ«²»³ÉÕý±ÈµÄ΢±¡¹¤×Ê£¬¾õµÃ×Ô¼ºÕætmdµÄ±¯¾ç£¡
»òÐíÕâ¾ÍÊÇÓ¦½ì±ÏÒµÉúµÄÃü°É...¶÷£¬ÏÖÔÚÎÒÒѾ²»ÊÇÓ¦½ì±ÏÒµÉúÁË...
ÏÖÔÚÏîÄ¿×öÍêÁË£¬ÎÒÒ²¾¡µ½ÁËÉÆʼÉÆÖÕµÄÒåÎñÁË...
¿àË®¾Íµ¹µ½ÕâÀ»¹ÊǻعéÕýÌâ¡£
ÓÉÓ ......