Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

gcc ±àÒë¶àÏß³ÌÎļþºÍº¬MySqlÊý¾Ý¿â²Ù×÷Îļþ

gcc Ç¿´óµÄ±àÒëÆ÷¾Í²»×÷½éÉÜÁË
linuxÏÂÓÃgccÃüÁî±àÒë¶àÏß³ÌC³ÌÐòÎļþºÍº¬ÓÐMySqlÊý¾Ý¿â²Ù×÷Îļþ
1.±àÒë¶àÏß³ÌÎļþ
gcc -o mylti_thread.o multi_thread.c -lpthread
ÆäÖеÄmulti_thread.c±íʾԴÎļþ£¬mylti_thread.o±íʾ±àÒë²úÉúµÄÄ¿±êÎļþ£¬-lpthread±íʾÒýÈë¶àÏ߳̿⣬ÔÚ¡¶Using the GNU Compiler Collection¡·gcc 4.30 ÖйØÓÚ-lpthreadµÄÃèÊöÈçÏ£º
-lpthread      Add support for multithreading using the POSIX threads library. This option sets flags for both the preprocessor and linker. It does not affect the thread safety of object code produced by the compiler or that of libraries supplied with it. These are HP-UX specific flags. Òª²»È»»á³öÏÖÀàËÆÒÔÏ´íÎó
/tmp/cc20DpmC.o: In function `main':
multi_thread.c:(.text+0x78): undefined reference to `pthread_create'
multi_thread.c:(.text+0xe2): undefined reference to `pthread_create'
multi_thread.c:(.text+0xf6): undefined reference to `pthread_join'
multi_thread.c:(.text+0x10a): undefined reference to `pthread_join'
2.±àÒëMySqlÊý¾Ý¿â²Ù×÷Îļþ
gcc -o sqltest.o sqltest.c -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient
»òÕßgcc -o sqltest $(mysql_config --cflags) sqltest.c $(mysql_config --libs)
   ²Î¼ûÍøÖ· http://blog.163.com/zhangjinqing1234@126/blog/static/30730260200992251411161/
ÆäÖеÄsqltest.c±íʾԴÎļþ£¬sqltest.o±íʾ±àÒë²úÉúµÄÄ¿±êÎļþ£¬-I±íʾָ¶¨Í·ÎļþµÄĬÈÏËÑË÷·¾¶£¬-L±íʾָ¶¨ÒªÁ´½ÓµÄ¿â£¬Í¬ÉÏÃæ-l£¬¾ßÌå¿É²Î¼ûÍøÖ·
http://blog.csdn.net/zhulinfeiba/archive/2009/08/20/4464727.aspx
-IºóÃæµÄ²ÎÊý/usr/include/mysql¿ÉÄÜ»áÒòΪMySql°²×°µÄ·¾¶²»Í¬¶øÓÐËù¸Ä±ä£¬ÔÚÖÕ¶ËÊäÈ룺whereis mysql£¬½á¹ûÈçÏ£º
mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql /usr/include/mysql
/usr/share/mysql /usr/share/man/man1/mysql.1.gz
ÔÙcd /usr/include/mysql
£¬È»ºó ls
decimal.h       my_dir.h         mysqld_error.h   sql_common.h
errmsg.h        my_getopt.h      mysql_embed.h &n


Ïà¹ØÎĵµ£º

MySQL´´Ê¼ÈË·¢ÓʼþѰÇóÖйú°ïÖú!

Ç×°®µÄÕü¾ÈMySQLµÄÖйúÇ©ÃûÖ§³ÖÕß:
    Å·ÃË¿ÉÄÜÎÞ·¨Õü¾ÈMySQL, ÖйúºÍ¶íÂÞ˹¿ÉÄÜÊÇÕü¾ÈMySQLµÄÏ£ÍûÖ®ËùÔÚ¡£ÖйúÓµÓÐÇ¿´ó¡¢¶ÀÁ¢ÒÔ¼°×ÔÐŵķ´Â¢¶ÏÖ÷¹Ü»ú¹Ø£¬Òò´Ë£¬ÎÒ±¾ÈËÔÚ´ËÇëÇóÄúµÄ°ïÖú¡£¶ÔÓÚÄúÔÚ http://helpmysql.org/cn/petition
µÄÇ©Ãû£¬ÎÒÃÇÉî±í¸Ðл¡£Èç¹û¿ÉÒԵϰ£¬ÎÒÃÇÐèÒªÄúµÄ½øÒ»²½°ïÖú£º
&nb ......

mysqlÐÂÔöÓû§ºÍµÇ¼


ÐÂÔöÓû§£º
GRANT ALL PRIVILEGES ON *.* TO 'root'@'ÄãµÄÔ¶¶Ëip' IDENTIFIED BY 'ÄãµÄÃÜÂë' WITH GRANT OPTION;
È磺
GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.10.19.220' IDENTIFIED BY '123456' WITH GRANT OPTION;
µÇ¼µ½ÐÂÔöµÄÓû§£º£¨¼ÙÈçÔ­ÊÚȨ»úµÄIPΪ10.10.19.222£©
mysql -uroot  -p123456&n ......

mysqlÖеÄunionºÍorder by¡¢limit

ÎÒÓÐÒ»¸ö±í
CREATE TABLE `test1` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `desc` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
£¨1£©ÒÔϲéѯ»á±¨´íÎó£º[Err] 1221 - Incorrect usage of UNION and ORDE ......

mysqlÖÐcountº¯Êý×¢ÒâÊÂÏî

񡜧
CREATE TABLE `user` (
  `id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(10) DEFAULT NULL,
  `password` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
ÆäÖÐÓÐÊý¾ÝΪ£º
1 name1 123456
2&nbs ......

Hibernate²åÈëmysqlÊý¾Ý¿âÖÐÎÄÂÒÂë½â¾ö


ʹÓÃant¹¤¾ß±àÒë³ÌÐò£¬ÔËÐгÌÐò.ÃüÁî:ant -f xxx.xmlÖ¸¶¨Éú³ÉÎļþ£»ant run±àÒë²¢ÔËÐÐÎļþ¡£
Èç¹ûHibernate½«ÖÐÎIJåÈëmysqlÊý¾Ý¿â£¬µ÷ÓÃselectÓï¾äÖÐÎÄÏÔʾÂÒÂ룬ÔòmysqlµÄ±àÂ뷽ʽÉèΪgbk£¬×¢ÒâÕâÀïÊÇСд£¬²»ÓÃÖØÐ°²×°mysqlÊý¾Ý¿â£¬½«MySQL Server 5.1Ŀ¼ÏµÄmy.iniÅäÖÃÎļþÀïµÄËùÓÐdefault-character-setÉèΪgbk£¬× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ