vds的mysql在linux的操作和字段详解

来源:互联网 发布:诺依曼枕头 知乎 编辑:程序博客网 时间:2024/06/06 09:41
1 在34上(我们的linux服务器),以root用户登录linux直接用‘mysql’命令进入mysql的命令行
2 show databases; 显示数据库列表,一定要加上分号,在回车
3 use ‘数据库’;比如use vds;显示databases changed 则表示当前已经进入到vds数据库下;
4 show '数据库'; 如show vds; 展示vds 下的所有表  这里错误,是show  tables;
5 selest * from table;查询这个表的所有字段
6 describe  table;查询这张表的表结构




vds下的所有的表(7张表)
client_loginout_t 空表
Field               | Type        | Null | Key | Default | Extra          |
+---------------------+-------------+------+-----+---------+----------------+
| id                  | int(11)     | NO   | PRI | NULL    | auto_increment |
| mac                 | varchar(20) | NO   |     | NULL    |                |
| device_mac          | varchar(20) | NO   |     | NULL    |                |
| associate_timestamp | int(11)     | NO   | MUL | NULL    |                |
| logout_time         | int(11)     | NO   |     | NULL    |                |
| online_time         | int(11)     | NO   |     | NULL    |                |
| admin_id            | int(11)     | YES  |     | NULL    |  




client_pv_t 空表
 Field             | Type        | Null | Key | Default | Extra          |
+-------------------+-------------+------+-----+---------+----------------+
| id                | int(11)     | NO   | PRI | NULL    | auto_increment |
| mac               | varchar(20) | NO   |     | NULL    |                |
| device_mac        | varchar(20) | YES  |     | NULL    |                |
| rssi              | float       | YES  |     | NULL    |                |
| x                 | float       | YES  |     | NULL    |                |
| y                 | float       | YES  |     | NULL    |                |
| is_Roaming        | tinyint(1)  | YES  |     | 0       |                |
| current_timestamp | int(11)     | NO   | MUL | NULL    |    






client_visit_t(空表)
Field        | Type    | Null | Key | Default | Extra          |
+--------------+---------+------+-----+---------+----------------+
| id           | int(11) | NO   | PRI | NULL    | auto_increment |
| dimension_id | int(11) | NO   |     | NULL    |                |
| day          | int(11) | NO   |     | NULL    |                |
| hour         | int(11) | YES  |     | NULL    |                |
| count        | int(11) | YES  |     | NULL    |                |
| type         | int(2)  | NO   |     | NULL    |                |
| admin_id     | int(11) | YES  |     | NULL    |            








device_t vsm和ap 的信息
 Field    | Type         | Null | Key | Default | Extra          |
+----------+--------------+------+-----+---------+----------------+
| id       | int(11)      | NO   | PRI | NULL    | auto_increment |
| mac      | varchar(20)  | NO   |     | NULL    |                |
| type     | int(1)       | NO   |     | 1       |                |
| name     | varchar(255) | NO   |     | NULL    |                |
| admin_id | int(11)      | NO   |     | NULL    |                 
id  auto 自动增长类型
mac 是设配的唯一表示符
type是区分vsm和ap的标志 1 表示ap 2表示vsm
name 为设配 取得名字 从表来看,ap是以ap+mac地址作为name vsm是直接以mac地址作为name
admin_id 设配所属的用户


dimension_device_t   ap在维度中的位置
 Field        | Type        | Null | Key | Default | Extra          |
+--------------+-------------+------+-----+---------+----------------+
| id           | int(11)     | NO   | PRI | NULL    | auto_increment |
| dimension_id | int(11)     | YES  |     | NULL    |                |
| mac          | varchar(20) | YES  |     | NULL    |                |
| x            | float       | YES  |     | NULL    |                |
| y            | float       | YES  |     | NULL    |                |
| radii        | float       | YES  |     | NULL    |                |
| start_angle  | float       | YES  |     | NULL    |                |
| end_angle    | float       | YES  |     | NULL    |                    
id auto 系统给的
dimension_id 这个应该是维度的标示符
mac 设备的唯一标示符
x  y就是设备在维度响应dimension_id(所在维度)的坐标
radii start_angle end_ang暂时不知道什么意思




dimension_img_t    关于维度的信息


| Field        | Type          | Null | Key | Default | Extra          |
+--------------+---------------+------+-----+---------+----------------+
| id           | int(11)       | NO   | PRI | NULL    | auto_increment |
| dimension_id | int(11)       | NO   | UNI | NULL    |                |
| img_path     | varchar(255)  | NO   |     | NULL    |                |
| img_width    | decimal(10,0) | NO   |     | NULL    |                |
| img_height   | decimal(10,0) | NO   |     | NULL    |                |
| real_length  | decimal(10,0) | YES  |     | 0       |                |
| real_width   | decimal(10,0) | YES  |     | 0       |        
id  auto 
dimension_id  维度的唯一表示符
img_path 图片上传的相对路劲
img_width  和img_height 图片的宽和高
real_length 和real_width 暂时不知
decimal这是mysql的一中数据类型


dimension_t
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      | NO   | PRI | NULL    | auto_increment |
| pid         | int(11)      | NO   |     | NULL    |                |
| name        | varchar(255) | NO   |     | NULL    |                |
| tag         | varchar(255) | YES  |     |         |                |
| description | varchar(255) | YES  |     | NULL    |                |
| admin_id    | int(11)      | NO   |     | NULL    |                |
| level       | int(5)       | NO   |     | 0       |             
id auto 系统给的
pid 父维度
name 维度的名字
tag ??
description 描述
admin_id  所属的vds用户
level 级别
0 0
原创粉丝点击