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¡£
Ïà¹ØÎĵµ£º
ΪʲôѡÔñÔ´Âë±àÒë°²×°mysql£ºÎÒÔÚʹÓÃrpm»òÕßÊÇyum°²×°Ê±myql£¬ÀÏÊÇÌáʾÎÒÕÒ²»µ½*.sockÎļþ£¬ÕÒÁ˵ã
×ÊÁÏ˵ÊǸðüÊǷǹٷ½°æ±¾£¨Ã÷Ã÷Êǹٷ½ÏÂÔØ µÄ£©£¬ÆäÖÐÔÒòµ½ÏÖÔÚ»¹Ã»ÓиãÇå³þ¡£Ï£ÍûÖªÇéÈËÊ¿¸æÖª¡££¨¿ªÊ¼±àÒëµÄʱºò£¬ÏµÍ³»·¾³Ò»¶¨ÒªÅäÖúã¬GCC£¬GC++...µÈµÈµÄ±àÒëÆ÷Ò»¶¨Òª×öºÃ,±¾È˵ÄcentosÓÉÓÚ¿ªÊ¼
ϵͳ»·¾ ......
ÐÞ¸Ä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 server ÊǷdz£·±Ã¦£¬¿ÉÒÔ¿ªÆô query cache ÒÔ¼ÓËÙ»ØÓ¦Ê±¼ä£¬¿ªÆô·½·¨¿ÉÒÔÔÚ my.cnf 裡Ãæ¼ÓÈëÒÔÏÂÏîÄ¿: (Redhat ÏÂÃæÊÇ /etc/my.cnf£»Debian ÊÇÔÚ etc/mysql
/my.cnf).
query_cache_size = 64M
query_cache_type = 1
query_cache_limit = 1048576
ÒÔÉÏÓï·¨µÄÉ趨ÀïÃæ£¬ ......
Ò»¸ö¼òµ¥Ê¾Àý--
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) {
......
¡¡±àÒëºÍÁ¬½Ó³ÌÐò
¡¡¡¡MySQLÖÐÓÐÒ»¸öÌØÊâµÄ½Å±¾,½Ð×ömysql_config. Ëü»áΪÄã±àÒëMySQL¿Í»§¶Ë,²¢Á¬½Óµ½MySQL·þÎñÆ÷ÌṩÓÐÓõÄÐÅÏ¢.ÄãÐèҪʹÓÃÏÂÃæÁ½¸öÑ¡Ïî.
¡¡¡¡1. --libs Ñ¡Ïî - Á¬½ÓMySQL¿Í»§¶Ëº¯Êý¿âËùÐèÒªµÄ¿âºÍÑ¡Ïî.
¡¡¡¡$ mysql_config --libs
¡¡¡¡2. --cflags Ñ¡Ïî - ʹÓñØÒªµÄincludeÎļþµÄÑ¡ÏîµÈµÈ.
......