MySQLÖг£ÓõÄÐ޸ıíµÄÃüÁî
MySQLÖг£ÓõÄÐ޸ıíµÄÃüÁî
¹Ø¼ü×Ö: mysql, Ð޸ıí, ÃüÁî
ÔÚÊý¾Ý¿â²Ù×÷ÖÐ,¸öÈ˾õµÃʹÓõÃ×î¶àµÄ¾ÍÊDzéѯ,È»ºó¾ÍÊǶԱíµÄÐ޸IJÙ×÷ÁË,ÓÈÆäÊǵ±Êý¾Ý¿âµÄÉè¼Æ¹¤×÷ûÓÐ×öºÃʱ.ÏÂÃæ¾ÍMySQLÖÐһЩ³£ÓõÄÐ޸ıíµÄ²Ù×÷½øÐÐ×ܽá:
ΪÁË·½±ãºóÃæµÄ˵Ã÷,ÏÈ´´½¨Ò»¸ö±í,´´½¨Óï¾äÈçÏÂ:
Create Table member(
id Int(3),
name Varchar(8),
pass Varchar(25)
);
1.Ïò±ímemberÖÐÔö¼ÓÒ»¸öÐÂÁÐemail,MySQLÓï¾äÈçÏÂ:
Alter Table member Add email Varchar(50) Not Null;
Describe member;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id | int(3) | YES | | NULL | |
| name | varchar(8) | YES | | NULL | |
| pass | varchar(8) | YES | | NULL | |
| email | varchar(50) | NO | | NULL | |
+-------+-------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
2.Ïò±ímemberÖÐÌí¼ÓÒ»¸öеÄÖ÷¼üid,MySQLÓï¾äÈçÏÂ:
Alter Table member Add Primary Key(id);
Describe member;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id | int(3) | NO | PRI | 0 | |
| name | varchar(8) | YES | | NULL
Ïà¹ØÎĵµ£º
ÎÒÒ»Ö±ÊÇʹÓÃmysqlÕâ¸öÊý¾Ý¿âÈí¼þ£¬Ëü¹¤×÷±È½ÏÎȶ¨£¬Ð§ÂÊÒ²ºÜ¸ß¡£ÔÚÓöµ½ÑÏÖØÐÔÄÜÎÊÌâʱ£¬Ò»°ã¶¼ÓÐÕâô¼¸ÖÖ¿ÉÄÜ£º
1¡¢Ë÷ÒýûÓн¨ºÃ£»
2¡¢sqlд·¨¹ýÓÚ¸´ÔÓ£»
3¡¢ÅäÖôíÎó£»
4¡¢»úÆ÷ʵÔÚ¸ººÉ²»ÁË£»
1¡¢Ë÷ÒýûÓн¨ºÃ
Èç¹û¿´µ½mysqlÏûºÄµÄcpuºÜ´ó£¬¿ÉÒÔÓÃmysqlµÄclient¹¤¾ßÀ´¼ì²é¡£
ÔÚlinuxÏÂÖ´ÐÐ
/usr/local/mysql/bin/ ......
ÓкܶàÓ¦ÓÃÏîÄ¿, ¸ÕÆð²½µÄʱºòÓÃMYSQLÊý¾Ý¿â»ù±¾ÉÏÄÜʵÏÖ¸÷ÖÖ¹¦ÄÜÐèÇó£¬Ëæ×ÅÓ¦ÓÃÓû§µÄÔö¶à£¬Êý¾ÝÁ¿µÄÔö¼Ó£¬MYSQL½¥½¥µØ³öÏÖ²»¿°ÖظºµÄÇé¿ö£º
Á¬½ÓºÜÂýÉõÖÁå´»ú£¬ÓÚÊǾÍÓаÑÊý¾Ý´ÓMYSQLǨµ½ORACLEµÄÐèÇó£¬Ó¦ÓóÌÐòÒ²ÒªÏàÓ¦×öһЩÐ޸ġ£±¾ÈË×ܽá³öÒÔϼ¸µã×¢ÒâÊÂÏϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1£® ×Ô¶¯Ôö³¤µÄÊý¾ÝÀàÐ ......
1.1.1 MySQLÏÂÔØ¡¢°²×°ÓëÆô¶¯
ÔÚʹÓÃMySQL֮ǰ£¬ÐèÒª½¨Á¢Êý¾Ý¿âµÄ»·¾³À´´´½¨Êý¾Ý±í£¬Ê×ÏÈÎÒÃÇÐèÒª°²×°¸ÃÊý¾Ý¿â»·¾³£¬¼´MySQL¡£
1¡¢ÏÂÔØMySQL
MySQLµÄ¹Ù·½ÍøÕ¾ÊÇhttp://www.mysql.org/£¬Èçͼ2-9Ëùʾ£º
ͼ2-9 MySQL¹Ù·½ÍøÕ¾
µ±Ç°Îȶ¨°æ±¾Îª5.1£¬ÎÒÃÇÑ¡ÓÃMySQL 5.1.22×÷ΪÊý¾Ý¿â·þÎñÆ÷£¬µ½Æä¹Ù·½ ......
1. ÔÚʹÓÃNavicat 8 for MySQL¿Í»§¶Ë´´½¨Êý¾Ý¿âʱ£¬±àÂëµÄÉèÖÃÈçÏÂͼ£º
2. ½«°²×°Ä¿Â¼F:\MySQL\MySQL Server 5.1Ï£¬my.iniÎļþÉèÖñäÁ¿Öµdefault-character-set=gbk £¨°üº¬Á½´¦£¬¿É²éÕÒdefault-character-set£©£¬È»ºóÖØÆôMYSQL·þÎñ¡£ ......
Ê×ÏÈ¿´¿´ jspÎļþ java³ÌÐòÀïÓÐûÓÐrequest.setCharacterEncoding("UTF-8");
×Ö·û±àÂëÎÊÌ⣬Êý¾Ý²åÈë¿âÖÐʱ£¬java±àÂëºÍÊý¾Ý¿â±àÂë²»Ò»Ö£¬µ¼Ö²åÈëÊý¾Ý¿âΪÂÒÂ룬¿´µ½Îª£¿£¿£¿£¿µÄÐÎʽ
½«ÄãµÄjspÒ³Ãæ±àÂë¸ÄΪGBK£¬Êý¾Ý¿â¶ÔÓ¦±íµÄ±àÂëÒ²¸ÄΪGBK
±àÂëÒ»Ö£¬¾Í²»»á³öÏÖÂÒÂëÎÊÌâÁ ......