ת£ºLinuxϽøÐÐMYSQLµÄC++±à³ÌÆð²½ÊÖ¼Ç
LinuxϽøÐÐMYSQLµÄC++±à³ÌÆð²½ÊÖ¼Ç
Ê×ÏÈ°²×°±ØÐèµÄ¿ª·¢°ü
sudo apt-get install gcc g++ libgcc1 libg++ make gdb
°²×°MYSQLµÄCÓïÑÔ¿ª·¢°ü
sudo apt-get install libmysql++-dev libmysql++2c2a libmysqlclient15-dev libmysqlclient15off
°ÑlibÎļþ¿½±´µ½¹«ÓÃ
sudo cp /usr/lib/mysql/* /usr/lib/
½¨Á¢Ò»¸öÐÂÎļþtest.cpp
nano test.cpp
ÊäÈëÄÚÈÝ
#include <stdio.h>
#include <stdlib.h>
#include "/usr/include/mysql/mysql.h"
int main() {
MYSQL mysql;
mysql_init(&mysql);
}
ctrl+O±£´æctrl+xÍ˳ö¡£
È»ºó±àÒë
g++ -lmysqlclient test.cpp -o test
ÔËÐÐ
./test
Èç¹ûʲô¶¼Ã»Ìáʾ£¬Ã»´íÎ󣬾Í˵Ã÷³É¹¦ÁË¡£
¾ÍÊÇÕâÑù¡£¶÷¡£»¹ÊÇÂú¡£¡£¡£¼òµ¥µÄ˵¡£
Ïà¹ØÎĵµ£º
http://www.blogjava.net/Alpha/archive/2007/07/23/131912.html
//Ö÷¼ü549830479
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//Ôö¼ÓÒ»¸öÐÂÁÐ549830479
alter table t2 add d timestamp;
alter table infos add ex tinyint n ......
2007-11-16 15:37
½ñÌì¿´×ÅÊÖ²áÊÔÁËÏ£¬·¢ÏÖÔÀ´´óÊý¾Ýµ¼Èëµ¼³öÊÇÄÇôµÄÇáËÉ£¨²»ÊǺܴó£¬200¶àMµÄÎı¾¶øÒÔ£©
×¢Ò⣺Èç¹û·¢ÏÖMYSQL unknown command '\'ÕâÑùµÄÌáʾ£¬ÔòÉèÖÃһϷþÎñÆ÷µÄ×Ö·û¼¯£¬È磺
mysql -uroot -ppasspass --default-character-set=utf8 databaseName <d:bakcup.sql
ÕâÑù¾Í²»»á±¨´íÁË£¬^_^
µ¼³ö ......
use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
Ê×ÏÈÒªÉùÃ÷Ò»µã£¬´ó²¿·ÖÇé¿öÏ£¬ÐÞ¸ÄMySQLÊÇÐèÒªÓÐmysqlÀïµÄrootȨÏ޵ģ¬
ËùÒÔÒ»°ãÓû§ÎÞ·¨¸ü¸ÄÃÜÂ룬³ý·ÇÇëÇó¹ÜÀíÔ±¡£
·½·¨Ò»
ʹÓÃphpmyadmin£¬ÕâÊÇ×î¼òµ¥µÄÁË£¬ÐÞ¸Ämysql¿âµ ......
Ò»)ANSI clockº¯Êý
1)¸ÅÊö:
clock º¯ÊýµÄ·µ»ØÖµÀàÐÍÊÇclock_t,Ëü³ýÒÔCLOCKS_PER_SECÀ´µÃ³öʱ¼ä,Ò»°ãÓÃÁ½´Îclockº¯ÊýÀ´¼ÆËã½ø³Ì×ÔÉíÔËÐеÄʱ¼ä.
ANSI clockÓÐÈý¸öÎÊÌâ:
1)Èç¹û³¬¹ýÒ»¸öСʱ,½«Òªµ¼ÖÂÒç³ö.
2)º¯ÊýclockûÓп¼ÂÇCPU±»×Ó½ø³ÌʹÓõÄÇé¿ö.
3)Ò²²»ÄÜÇø·ÖÓû§¿Õ¼äºÍÄں˿ռä.
ËùÒÔclockº¯ÊýÔÚlinuxϵͳÉϱäµÃ ......
±¾ÎÄÌÖÂÛÁË UNIX/LINUX ƽ̨ÏÂÈýÖÖÖ÷ÒªµÄ¿ÉÖ´ÐÐÎļþ¸ñʽ£ºa.out£¨assembler and link
editor output »ã±àÆ÷ºÍÁ´½Ó±à¼Æ÷µÄÊä³ö£©¡¢COFF£¨Common Object File Format
ͨÓöÔÏóÎļþ¸ñʽ£©¡¢ELF£¨Executable and Linking Format
¿ÉÖ´ÐкÍÁ´½Ó¸ñʽ£©¡£Ê×ÏÈÊǶԿÉÖ´ÐÐÎļþ¸ñʽµÄÒ»¸ö×ÛÊö£¬²¢Í¨¹ýÃèÊö ELF
Îļþ¼ÓÔعý³ÌÒÔ½Òʾ ......