linux Ï ÓÃcÓïÑÔ´´½¨mysqlÊý¾Ý¿â±Ê¼Ç£¨Ò»£©
linux Ï ÓÃcÓïÑÔ´´½¨mysqlÊý¾Ý¿â±Ê¼Ç£¨Ò»£©
£££££½öΪ¸öÈËѧϰժҪ£¬²¢²»¶Ï¸üÐÂÖС£¡£¡£¡£
ÔÚÒýÓÃÍ·Îļþʱ±ØÐë°üº¬‘mysql.h’µÄÍ·Îļþ(±ØÐëÊÇmysql.hµÄ¾ø¶ÔµØÖ·£¬Ò»°ãÔÚmysqlϵÄincludeĿ¼Ï£¬×Ðϸ¿´¿´ÄãµÄÔÚÄÄÀ*),
ÎÒÊÇubuntu9¡£04£¬ÔÚ/usr/include/mysql/mysql.hÏÂ
ÓеÄlinux°æ±¾¿ÉÄÜÔÚ/usr/local/mysql/include/mysql/mysql.hÏ¡£
---- ¶ÔÆäÖм¸¸öº¯Êý×÷¼òµ¥ËµÃ÷£¬Ïêϸ˵Ã÷£¬¿É²Î¿¼MySQLÎĵµ£º
---- 1. MYSQL *mysql_init(MYSQL *mysql)
---- ³õʼ»¯Ò»¸öÀàÐÍΪMYSQLµÄÊý¾Ý½á¹¹£¬ÎªÖ´ÐÐmysql_real_connect()×ö×¼±¸¡£²ÎÊý
mysqlΪָÏò¸Ã½á¹¹µÄÖ¸Õ룬Èç¹ûmysqlΪNULL£¬Ôòн¨²¢³õʼ»¯Ò»¸öMYSQLµÄÊý¾Ý½á¹¹¡£
н¨µÄ½á¹¹½«ÔÚmysql_close()ÖÐÊÍ·Å¡£
---- Èô³É¹¦£¬·µ»Ø³õʼ»¯µÄMYSQLÊý¾Ý½á¹¹µÄÖ¸Õ룬·ñÔò·µ»ØNULL¡£
---- 2. MYSQL *mysql_real_connect(MYSQL *mysql, const char
*host,
---- const char *user, const char *passwd, const char *db,
---- unsigned int port, const char *unix_socket, unsigned int
client_flag)
---- ÓëMySQLÊý¾Ý¿âÒýÇ潨Á¢Á¬½Ó¡£ÔÚÖ´ÐнøÒ»²½µÄÊý¾Ý²Ù×÷֮ǰ£¬±ØÐë±£Ö¤mysql_re
al_connect()³É¹¦·µ»Ø¡£
---- ²ÎÊýmysqlÊÇmysql_init()µÄ·µ»ØÖµ£»
---- ²ÎÊýhostÊÇÔËÐÐMySQLÊý¾Ý¿âÒýÇæµÄ»úÆ÷µÄTCP/IPÖ÷»úÃû£¬ÈçΪNULLÔòĬÈÏΪ“lo
calhost”£»
---- ²ÎÊýuserºÍpasswdÊÇMySQLÊý¾Ý¿âµÄºÏ·¨Óû§ºÍ¿ÚÁ
---- ²ÎÊýdbÊÇÁ¬½ÓµÄÊý¾Ý¿âÃû£»
---- ²ÎÊýport£¬unix_socketºÍclient_flagÒ»°ãȡĬÈÏÖµ¡£
---- 3. int mysql_query(MYSQL *mysql, const char *query)
---- Ö´ÐÐquery×Ö·û´®ÖеÄSQLÓï¾ä£¬query±ØÐëÒÔ0½áβ¡£Èç¹û³É¹¦£¬·µ»Ø0¡£
---- 4. MYSQL_RES *mysql_store_result(MYSQL *mysql)
---- ·µ»ØSELECT£¬SHOW£¬DESCRIBE, EXPLAINµÈÓï¾äÖ´ÐеĽá¹û¡£º¯Êýн¨Ò»¸öMYSQL_
RESµÄÊý¾Ý½á¹¹£¬°Ñ½á¹û´æ´¢ÔڸýṹÖС£Èç¹û²éѯûÓÐÆ¥ÅäµÄ½á¹û£¬Ôò·µ»Ø¿ÕÊý¾Ý¼¯¡£
´¦ÀíÍê½á¹û¼¯ºó£¬±ØÐëµ÷ÓÃmysql_free_result()¡£
---- Èç¹û³ö´í£¬·µ»ØNULL£¬·ñÔò·µ»ØMYSQL_RES½á¹¹µÄÖ¸Õë¡£
---- 5. MYSQL_ROW mysql_fetch_row(MYSQL_RES *result)
---- È¡»Ø½á¹û¼¯ÖеÄÏÂÒ»Ìõ¼Ç¼£¬Èç¹ûûÓмǼ»ò³ö´í£¬·µ»ØNULL¡£Ò»Ìõ¼Ç¼ÖеÄ×Ö¶Î
Êý¿ÉÒÔÓÃmysql_num_fields(result)»ñµÃ£¬¸÷×ֶεÄÖµ¿ÉÒÔÓÃrow[0] µ½ row[mysql_nu
m_fields(result)-1]µÄÊý×éÀ´·ÃÎÊ¡£
Ïà¹ØÎĵµ£º
ÎÒʹÓõÄÊÇapserv°²×°°ü£¬°²×°Ê±ÓïÑÔÎÒÑ¡ÔñµÄÊÇgb2312£¬ºóÀ´ÔÚ½¨Á¢ÐµÄÊý¾Ý¿âʱ£¬‘ÕûÀí’Ñ¡ÔñµÄÊÇutf8£¬½ÓÏÂÀ´ÔÚ±íÖвÎÊýÀàÐÍ»ù±¾Ñ¡ÔñµÄ¶¼ÊÇutf8£¬½ÓÏÂÀ´ÎÒ¾ÍÖ±½Óµ÷ÓÃÀ²£¬¸Â¸Â£¬ÎÒдµÄÊÇÒ»¸ö¼òµ¥µÄÁôÑÔ±¾¡£×î¼òµ¥µÄ¶ÁÈ¡Êý¾Ý¿âдÈëÊý¾Ý¿âµÄ³ÌÐò£¬¸Â¸Â£¡Ææ¹ÖµÄÊÇÔÚÊý¾Ý¿âÀïÃæÖ±½Ó²Ù×÷ÖÐÎÄÏÔʾ¶¼ºÜÕý³£¡£¿ÉÊÇÒ»µ½Íø ......
°²×°MySQL
sudo apt-get install mysql-server mysql-admin mysql-navigator mysql-query-browser
Õâ¸öÓ¦¸ÃºÜ¼òµ¥ÁË£¬¶øÇÒÎÒ¾õµÃ´ó¼ÒÔÚ°²×°·½ÃæҲûʲô̫´óÎÊÌ⣬ËùÒÔÒ²¾Í²»¶à˵ÁË£¬ÏÂÃæÎÒÃÇÀ´½²½²ÅäÖá£
ÅäÖÃMySQL
×¢Ò⣬ÔÚUbuntuÏÂMySQLȱʡÊÇÖ»ÔÊÐí±¾µØ·ÃÎʵģ¬Èç¹ûÄãÒªÆäËû»úÆ÷Ò²Äܹ»·ÃÎʵĻ°£¬ÄÇôÐèÒª¸Ä±ä/etc/m ......
10055:ûÓлº´æ¿Õ¼ä¿ÉÀûÓà ·½·¨:²é¿´ÏÂÄãµÄCÅÌ¿Õ¼äÊÇ·ñÒѾÂú,Çå³ýһЩûÓÐÓõÄÎļþ. ¿ÉÒÔÔÚºǫ́µÄ"ÂÛ̳ºËÐÄÉèÖÃ","ºËÐŦÄÜÉèÖÃ"Àï"½ø³ÌÓÅ»¯"¿ªÆô,"GZIP ѹËõÊä³ö"¹Ø±Õ. ²éÕÒÁËÒ»ÏÂ10055£¨Ã»Óлº´æ
˵Ã÷:Èç¹ûÓöµ½Êý¾Ý¿â³ö´íµÄÎÊÌâÐÞ¸ÄÏàÓ¦µÄ´úÂëºóÒ»°ãÒªÖØÆômysql¡£Èç¹ûÓöµ½mysqlµÄÎÊÌâ¿ÉÒÔÏÈÖØÆ ......
MySql ×Ö·û´®º¯Êý
[ 2006-04-22 19:24:44 | Author: Ychon ]
Font Size: Large | Medium | Small
¶ÔÓÚÕë¶Ô×Ö·û´®Î»ÖõIJÙ×÷£¬µÚÒ»¸öλÖñ»±ê¼ÇΪ1¡£
ASCII(str)
·µ»Ø×Ö·û´®strµÄ×î×óÃæ×Ö·ûµÄASCII´úÂëÖµ¡£Èç¹ûstrÊÇ¿Õ×Ö·û´®£¬·µ»Ø0¡£Èç¹ûstrÊÇNULL£¬·µ»ØNULL¡£
mysql> select ASCII('2');
-> 50
mysql ......