Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java mysql ºº×Ö´æÈëʱÂÒÂë


´ÓÍøÂçÕª³­µ½µÄ½â¾ö·½·¨——
½â¾ö·½·¨¶þ£º
      Á¬½Ómysqlʱ(ÎÞÂÛÔÚ´Ómysql¶Á»¹ÊÇÈ¡Êý¾ÝµÄÇé¿ö)£¬Ö¸¶¨Ê¹ÓõıàÂ뷽ʽΪutf-8£¬¾ßÌå´úÂëÈçÏÂ
      //×°ÔØmysql-jdbcÇý¶¯
       Class.forName("com.mysql.jdbc.Driver").newInstance();
      //Á¬½ÓÊý¾Ý¿â
      Connection sqlCon = DriverManager.getConnection( "jdbc:mysql://localhost:3306/javatest?user=root&password=admin&useUnicode=true&characterEncoding=utf-8 " );
      ÎÒÊÇÓÃÕâ¸ö·½·¨½â¾öµÄ¡£
ÔÚÅäÖÃÎļþÖиÄΪ
url="jdbc:mysql://127.0.0.1/elearning?useUnicode=true&characterEncoding=utf-8"
³ö´í£¬ºó¸ÄΪurl="jdbc:mysql://127.0.0.1/elearning?useUnicode=true&characterEncoding=utf-8"
³É¹¦


Ïà¹ØÎĵµ£º

mysql´´½¨Óû§È¨ÏÞÓï·¨

create database testdb; /* ´´½¨Êý¾Ý¿â */
use testdb; /* ´ò¿ªÊý¾Ý¿â */
/*grant ÆÕͨÊý¾ÝÓû§£¬²éѯ¡¢²åÈë¡¢¸üС¢É¾³ý Êý¾Ý¿âÖÐËùÓбíÊý¾ÝµÄȨÀû*/
grant select,insert,update,delete on testdb.* to common_user@'%';
grant select,insert,update,delete on testdb.* to common_user@'localhost'; ......

MySQL±íÀàÐͼòµ¥¶Ô±È

MySQLΪÎÒÃÇÌṩÁ˺ܶà±íÀàÐ͹©Ñ¡Ôñ£¬ÓÐMyISAM¡¢ISAM¡¢HEAP¡¢BerkeleyDB¡¢InnoDB£¬MERGE±íÀàÐÍÿһÖÖ±íÀàÐͶ¼ÓÐÆä×Ô¼ºµÄÊôÐÔºÍÓŵ㡣ÏÂÃæÎÒÃÇÀ´¼òµ¥µÄÌÖÂÛһϡ£
MyISAM±íÀàÐÍ£º
MyISAM
±í(TYPE=MYISAM)ÊÇISAMÀàÐ͵ÄÒ»ÖÖÑÓÉ죬¾ßÓкܶàÓÅ»¯ºÍÔöÇ¿µÄÌØÐÔ¡£ÊÇMySQLµÄĬÈϱíÀàÐÍ¡£MyISAMÓÅ»¯ÁËѹËõ±ÈÀýºÍËٶȣ¬²¢ÇÒ
¿ÉÒ& ......

MySQLÖ÷´Ó·þÎñÆ÷£¨Replication£©µÄÉèÖÃ

Ê×ÏÈÉèÖÃMySQLÖ÷·þÎñÆ÷£º
ÔÚÖ÷·þÎñÆ÷ÉÏΪ´Ó·þÎñÆ÷½¨Á¢Ò»¸öÓû§£º
grant replication slave on *.* to 'Óû§Ãû'@'Ö÷»ú' identified by 'ÃÜÂë';
Èç¹ûʹÓõÄÊÇMySQL 4.0.2֮ǰµÄ°æ±¾£¬ÔòÓÃfileȨÏÞÀ´´úÌæreplication slave
±à¼­Ö÷·þÎñÆ÷µÄÅäÖÃÎļþ£º/etc/my.cnf
server-id=1
log-bin
binlog-do-db=ÐèÒª¸´ÖƵÄÊý¾Ý¿âÃû£ ......

MySQLµ¼Èëµ¼³öÃüÁî

MySQLµ¼Èëµ¼³öÃüÁî
1.µ¼³öÕû¸öÊý¾Ý¿â
¡¡¡¡mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
¡¡¡¡mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
2.µ¼³öÒ»¸ö±í
¡¡¡¡mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû ±íÃû> µ¼³öµÄÎļþÃû
¡¡¡¡mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql
3.µ¼³öÒ ......

MySQLÓëJSP ÂÒÂëÎÊÌâ½â¾ö

ÂÒÂëÕæÊǸöÁîÈËÌÖÑáµÄÎÊÌâ~
¸Õ²ÅÖÕÓÚ°ÑMySQLÓëJSP½»»¥µÄÂÒÂëÎÊÌâ½â¾öÁË¡£
°ì·¨ÈçÏ£º
1.ÔÚurl´¦¼ÓÉϾä×Ó "&useUnicode=true&characterEncoding=GBK" £»
2.ÎÒÓÃNavicat Lite¿ÉÊÓ»¯¹¤¾ß´´½¨MySQLÊý¾Ý¿âʱ£¬¿ÉÑ¡¶¨Êý¾Ý¿â±àÂ룬ҲÊÇ GBK £»
3.Ò³ÃæµÄ±àÂë¿ÉÒÔÑ¡GBKÒÔÍâµÄ±àÂ뷽ʽ£¬ÈçUTF-8¡£Èô²Ù×÷Ò³ÃæµÄ±àÂëÊÇUTF- ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ