创建一个用户

insert into mysql.user(Host,User,Password) values("localhost","gisuser",password("1234"));

create database gis;

grant all privileges on gis.* to 'gisuser'@'%' identified by '1234';

create table loc_info(id varchar (32)  not null  ,longitude  varchar(32) not null ,latitude varchar (32) not null , time DATETIME  not null);


#include "WINSOCK2.H"
#include "mysql.h"
#pragma comment(lib,"libmysql.lib")
int appenddb(char* uid,char*latitude,char*longitude,char*time)
{
    MYSQL *mysql;//数据库连接句柄  
	mysql = (MYSQL *)malloc(sizeof(MYSQL));      
	mysql_init(mysql);  
	
	mysql=mysql_real_connect(mysql,"localhost","test","1234","gis",3306,NULL,0);  
	if(!mysql)  
	{  
		printf("conn fail... ");  
		return FALSE;  
    }  
	char * strsql = new char[1000];
	sprintf(strsql,"insert into loc_info(id,longitude,latitude,time) values ('%s','%s','%s','%s');",uid,latitude,longitude,time);
	//strcpy(strsql,"delete from loc_info;");
	if(mysql_query(mysql,(char*)(LPCTSTR)strsql))
    {   
		OutputDebugString(strsql);
        OutputDebugString(mysql_error(mysql));  
    }  
	mysql_close(mysql);
	free(mysql);
	delete strsql;
}

$data=$pdo->query("select DISTINCT id from loc_info");

stop time:<input type="text" name="stoptime" value="<?php echo date('Y-m-d H:i:s',time());?>"/>

grant select,insert,update,delete on gis.* to'user'@'localhost' Identified by 'password';

grant select,insert,update,delete on gis.* to'user'@'%' Identified by 'password';

error_reporting(0);

date_default_timezone_set("UTC");

1、将当前目录中的所有“子目录”的权限设置为755;
2、将当前目录中的所有“文件”的权限设置为644。

chmod 644 -R *
chmod 755 `find -type d`

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值