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ΪÎÒÃÇÌṩÁ˺ܶà±íÀàÐ͹©Ñ¡Ôñ£¬ÓÐMyISAM¡¢ISAM¡¢HEAP¡¢BerkeleyDB¡¢InnoDB£¬MERGE±íÀàÐÍÿһÖÖ±íÀàÐͶ¼ÓÐÆä×Ô¼ºµÄÊôÐÔºÍÓŵ㡣ÏÂÃæÎÒÃÇÀ´¼òµ¥µÄÌÖÂÛһϡ£
MyISAM±íÀàÐÍ£º
MyISAM
±í(TYPE=MYISAM)ÊÇISAMÀàÐ͵ÄÒ»ÖÖÑÓÉ죬¾ßÓкܶàÓÅ»¯ºÍÔöÇ¿µÄÌØÐÔ¡£ÊÇMySQLµÄĬÈϱíÀàÐÍ¡£MyISAMÓÅ»¯ÁËѹËõ±ÈÀýºÍËٶȣ¬²¢ÇÒ
¿ÉÒ& ......
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.µ¼³öÒ ......
1.´´½¨²âÊÔ±í
create table users(
userid int primary key,
username varchar2(20),
userpwd varchar2(20)
);
insert into users values(1,'test','test');
insert into users values(2,'test','test');
insert into users values(3,'test','test');
insert into users values(4,'test','test');
insert i ......
PHP·ÃÎÊMySQLÊý¾Ý¿âº¯Êý¼ò½é
1. ½øÐÐÊý¾Ý¿âÁ¬½Ó
Á¬½ÓÊý¾Ý¿â·þÎñÆ÷£¬¾ÍÊÇ¿Í»§¶ËÏò¼ºÔËÐеÄÊý¾Ý¿â·þÎñÆ÷·¢³öÁ¬½ÓÇëÇó£¬
³É¹¦ÒÔºó¾Í¿ÉÒÔ¶ÔÊý¾Ý¿â½øÐÐÏàÓ¦²Ù×÷£¬ÓÉÓÚÓû§µÄȨÏÞ²»Í¬£¬ËùÄܽø
ÐеIJÙ×÷Ò²²»Ò»Ñù¡£PHPÌṩÁËһϵÁÐMySQL ......
ÂÒÂëÕæÊǸöÁîÈËÌÖÑáµÄÎÊÌâ~
¸Õ²ÅÖÕÓÚ°ÑMySQLÓëJSP½»»¥µÄÂÒÂëÎÊÌâ½â¾öÁË¡£
°ì·¨ÈçÏ£º
1.ÔÚurl´¦¼ÓÉϾä×Ó "&useUnicode=true&characterEncoding=GBK" £»
2.ÎÒÓÃNavicat Lite¿ÉÊÓ»¯¹¤¾ß´´½¨MySQLÊý¾Ý¿âʱ£¬¿ÉÑ¡¶¨Êý¾Ý¿â±àÂ룬ҲÊÇ GBK £»
3.Ò³ÃæµÄ±àÂë¿ÉÒÔÑ¡GBKÒÔÍâµÄ±àÂ뷽ʽ£¬ÈçUTF-8¡£Èô²Ù×÷Ò³ÃæµÄ±àÂëÊÇUTF- ......