您的位置:首页 > 其它

创建一个用户

2015-09-04 16:31 218 查看
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';


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

error_reporting(0);

date_default_timezone_set("UTC");

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

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

chmod 644 -R *

chmod 755 `find -type d`
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: