ת£º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
Èç¹ûʲô¶¼Ã»Ìáʾ£¬Ã»´íÎ󣬾Í˵Ã÷³É¹¦ÁË¡£
¾ÍÊÇÕâÑù¡£¶÷¡£»¹ÊÇÂú¡£¡£¡£¼òµ¥µÄ˵¡£
Ïà¹ØÎĵµ£º
»ù´¡²¿·Ö
Ò»¡¢MySQL »ñµÃµ±Ç°ÈÕÆÚʱ¼ä º¯Êý
1.1 »ñµÃµ±Ç°ÈÕÆÚ+ʱ¼ä£¨date + time£©º¯Êý£ºnow()
mysql> select now();
+---------------------+
| now() |
+----------------- ......
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 ......
Ò»¡¢ÀûÓÃkillÃüÁî
ÏÈÓÃps -aÕÒµ½½ø³ÌºÅ£¬ÔÙÓÃsudo kill -stop procNumber£¬½«½ø³ÌÔÝÍ£¡£È»ºóÔÙÓÃjobs²é¿´Ò»ÏÂҪתµ½ºǫ́µÄ½ø³Ì£¬ÕÒµ½ËüµÄjobºÅ£¬×îºóÓÃbg jobNumber½«Æäתµ½ºǫ́¡£´ó¸Å¾ÍÏñÕâÑù£º
ps -a
PID TTY TIME CMD
6729 pts/0 &nb ......
1. °²×°helix server.
InstallRoot: /etc/httpd/rtsp
administrator account : yanweicheng/1
rtsp¶Ë¿ÚºÅ 554, http port: 8080, mms: 1755, Administrator request: 14525
2 Æô¶¯
cd $InstallRoot/Bin
&nb ......
ת×Ô:http://www.xxlinux.com/linux/article/development/kernel/20090112/14828.html
sysfs ÊÇ Linux ÄÚºË
ÖÐÉè¼Æ½ÏеÄÒ»ÖÖÐéÄâµÄ»ùÓÚÄÚ´æµÄÎļþϵͳ£¬ËüµÄ×÷ÓÃÓë proc ÓÐЩÀàËÆ£¬µ«³ýÁËÓë proc ÏàͬµÄ¾ßÓв鿴ºÍÉ趨ÄÚºË
²ÎÊý¹¦ÄÜÖ®Í⣬»¹ÓÐΪ Linux ͳһÉ豸ģÐÍ×÷Ϊ¹ÜÀíÖ®Óá£Ïà±ÈÓÚ proc Îļþϵͳ£¬Ê¹Óà sysfs µ¼³ ......