MySQLÖÐÓÃsqlÓï¾ä²åÈëʱÆÚ
mysql> create table testdate(
-> id int not null auto_increment primary key,
-> time date);
Query OK, 0 rows affected (0.30 sec)
mysql> insert into testdate(time) values('2010-4-23');
Query OK, 1 row affected (0.06 sec)
mysql> select * from testdate;
+----+------------+
| id | time |
+----+------------+
| 1 | 2010-4-23|
+----+------------+
1 row in set (0.00 sec)
mysql> alter table testdate add column current time;
Query OK, 1 row affected (0.25 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> update testdate set current='21:18:00' where id=1;
Query OK, 1 row affected (0.06 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from testdate;
+----+------------+----------+
| id | time | current |
+----+------------+----------+
| 1 | 2010-4-23 | 21:18:00 |
+----+------------+----------+
1 row in set (0.00 sec)
mysql> alter table testdate add column combine timestamp;
Query OK, 1 row affected (0.14 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> update testdate set combine='20050504212000' where id=1;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> select * from testdate;
+----+------------+----------+---------------------+
| id | time | current | combine |
+----+-------
Ïà¹ØÎĵµ£º
1¡¢ÐÞ¸ÄMySqlÊý¾Ý¿âµÄmy.iniÅäÖÃÎļþ¡¢
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If yo ......
¸ù¾ÝChaos WangµÄPPTÕûÀí¶ø³É£¬ ÔÚ´ËÔٴθÐлChaos WangµÄ´Ë´ÎTechTalk
»ù±¾¸ÅÄî
• ×Ö·û(Character)ÊÇÖ¸ÈËÀàÓïÑÔÖÐ×îСµÄ±íÒå·ûºÅ¡£ÀýÈç'A'¡¢'B'µÈ£»
• ¸ø¶¨Ò»ÏµÁÐ×Ö·û£¬¶Ôÿ¸ö×Ö·û¸³ÓèÒ»¸öÊýÖµ£¬ÓÃÊýÖµÀ´´ú±í¶ÔÓ¦µÄ×Ö·û£¬ÕâÒ»ÊýÖµ¾ÍÊÇ×Ö·ûµÄ±àÂë(Encoding)¡£ÀýÈ磬ÎÒÃǸø×Ö·û'A'¸³ÓèÊýÖµ0£¬¸ø×Ö·û'B'¸³ÓèÊýÖµ ......
ÔÚFC8ÖÐĬÈÏ°²×°µÄÓÐmysql£¬Ã»ÓеĻ°¿ÉÒԺܷ½±ãµÄ°²×°Ï¡£
ĬÈϵÄmysqlµÄincludeÎļþĿ¼ÔÚ/usr/include/mysql
ĬÈϵÄmysqlµÄlibÎļþ¼ÐÔÚ/usr/lib/mysql
ÕâÁ½¸öĿ¼ÔÚÎÒÃDZàÒëʱºòÐèÒªµ½¡£
ÎҵIJâÊÔÓõÄC´úÂëΪ£º
££include <stdio.h>
#include <stdlib.h>
#include <mysql.h>
#define CONN_HOST ......
Ò»¡¢×ÛÊö
ÃüÃûºÍ±àÂë¹ý³ÌÖУ¬¶¨ÒåÓÐÒâÒåµÄÃû³Æ£¬ÒÔÒ×ÓÚÀí½â¡¢·½±ãÊéдΪÔÔò¡£
£¨1£©±ÜÃâʹÓÃÖÐÎÄ£¬¾¡Á¿Ê¹ÓÃÈ«Æ´Òô»òÈ«Ó¢ÎÄ£¬ÒÔ·½±ã¹ú¼Ê»¯£»
£¨2£©±ÜÃâÆ´ÒôºÍÓ¢ÎĵÄÖÐÎ÷ºÏèµ£¬È磺CAOZUO_TIME£»
£¨3£©±ÜÃâÔÚÃüÃûÖаüÀ¨¿Õ¸ñ¼°ÌØÊâ×Ö·û£»
£¨4£©±ÜÃâʹÓñ£Áô×Ö£»
£¨5£©±ÜÃâÃû³ÆÌ«³¤£¬×¢ÒâËõдµÄʹÓã¬Ëõд¹æÔòΪµ¥´ÊÇ°4¸ ......