MySQLÓëJSP ÂÒÂëÎÊÌâ½â¾ö
ÂÒÂëÕæÊǸöÁîÈËÌÖÑáµÄÎÊÌâ~
¸Õ²ÅÖÕÓÚ°ÑMySQLÓëJSP½»»¥µÄÂÒÂëÎÊÌâ½â¾öÁË¡£
°ì·¨ÈçÏ£º
1.ÔÚurl´¦¼ÓÉϾä×Ó "&useUnicode=true&characterEncoding=GBK" £»
2.ÎÒÓÃNavicat Lite¿ÉÊÓ»¯¹¤¾ß´´½¨MySQLÊý¾Ý¿âʱ£¬¿ÉÑ¡¶¨Êý¾Ý¿â±àÂ룬ҲÊÇ GBK £»
3.Ò³ÃæµÄ±àÂë¿ÉÒÔÑ¡GBKÒÔÍâµÄ±àÂ뷽ʽ£¬ÈçUTF-8¡£Èô²Ù×÷Ò³ÃæµÄ±àÂëÊÇUTF-8£¬Ôò²Ù×÷Ò³ÃæÉÏÒªÒ»¾ärequest.setCharacterEncoding("UTF-8");
»òÕß´óÕУ¬±ÈÈçnew String(name.getBytes("ISO-8859-1"),"UTF-8"); ÎÒϲ»¶µÚÒ»ÖÖ¡£
¸½ÉÏÀý×ÓÒ»¸ö£º
//JSP²åÈëÊý¾Ýµ½Êý¾Ý¿â------------------------------
ǰ̨ÏÔʾҳÃæ----------------------------------------------------------------------
<div align="center">
<form action="data/InsertHandle.jsp" method="post">
ͼÊéÃû³Æ£º<input type="text" name="name" /><br>
³ö°æÉ磺 <input type="text" name="publisher" /><br>
ͼÊé¼Û¸ñ£º<input type="text" name="price" /><br>
<input type="submit" value="Ìá½»">
</form>
</div>
Êý¾Ý²åÈëµÄ²Ù×÷Ò³Ãæ---------------------------------------------------------------
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'InsertHandle.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
Ïà¹ØÎĵµ£º
1.ÏÂÔØ MySQL 6.0Ãâ°²×°°æ
http://dev.mysql.com/get/Downloads/MySQL-6.0/mysql-noinstall-6.0.9-alpha-win32.zip/from/pick#mirrors
2.½« MySQL6.0 ½âѹµ½´ý°²×°Ä¿Â¼(×Ô¼º¾ö¶¨·Åµ½ÄÄ£©¡£½âѹºóĬÈÏÎļþ¼ÐÃû³ÆΪ£ºmysql-6.0.9-alpha-win32£¨µ±È»¿ÉÒÔ×Ô¼º¸ü¸Ä£©£¬È»ºóÔÚ»·¾³±äÁ¿ÖÐÉèÖÃMYSQL_HOME£¨ÕâÑù£¬ÒÔºó¿ÉÒÔÓÃ%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'; ......
(1)ʵÏÖÈýá¹û¼¯A-½á¹û¼¯B£º--ÀûÓÃnot
exists£¬ºÏ²¢Ôò¿ÉÓÃunion
exists,not
exists£ºÓÃÓÚÅжÏÇÒ»ñÈ¡½á¹û¼¯AÊÇ·ñ´æÔڵؽá¹û¼¯BÖÐ!
==========½á¹û¼¯A£º
SELECT
d.Device_ID,d.Device_Name,a.App_ID,a.App_Name
from
T_ ......
Ó¦¸Ã˵һ°ãµÄÊý¾Ý¿â¶¼ÓÐBackUpµÄÐèÇó, MySql±¸·ÝÊý¾Ý¿âµÄ·½Ê½ºÜ¼òµ¥, µ«ÊÇÔÚÍøÉÏ˵µÃÔÆÀïÎíÀï, Ò²Ó¦¸ÃÊÇÎÒ¶ÔMySqlÊý¾Ý¿â²»ÊìϤ.
Ä¿±ê(Target) : ½«±¾»úÖеÄmysqlÊý¾Ý¿â±¸·Ýµ½±¾»úÖеÄmydatabaseÊý¾Ý¿âÖÐ - Ò²¾ÍÊÇÍêÈ«µÄCopyÒ»¸öÊý¾Ý¿â.
#1. C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -u ......
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.µ¼³öÒ ......