mysql -h irtfweb -u spex -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 202501
Server version: 5.1.67 Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| autofocus          |
| eventumdb          |
| fct                |
| feedback           |
| frizzell           |
| iqup               |
| irtf_imagedb       |
| mysql              |
| nsf2butemps        |
| nsf2temps          |
| nsfcam25_data      |
| spex               |
| temp               |
| test               |
| test_dewar         |
| tiki-1             |
| troublelog         |
| troublelog2        |
| troublelog3        |
| upload             |
| vehicle            |
| wikidb             |
+--------------------+


mysql> use spex;
Database changed

mysql> show tables;
+----------------+
| Tables_in_spex |
+----------------+
| Data           |
| Sensors        |
+----------------+
2 rows in set (0.00 sec)

mysql> SELECT * FROM Sensors;
+-----------+--------------------------------------------------------+
| SensorID  | Notes                                                  |
+-----------+--------------------------------------------------------+
| bg_cdat   | bigdog control temperature, kelvin                     |
| bg_sdat   | bigdog sample  temperature, kelvin                     |
| bg_setpt  | bigdog control set point, kelvin                       |
| bg_heat   | bigdog heater output, 0-100, percent.                  |
| bg_range  | bigdog heater range 0,1,2,3 for off, low, med, high.   |
| bg_p      | bigdog P value                                         |
| bg_i      | bigdog I value                                         |
| bg_d      | bigdog D value                                         |
| gd_cdat   | guidedog control temperature, kelvin                   |
| gd_sdat   | guidedog sample  temperature, kelvin                   |
| gd_setpt  | guidedog control set point, kelvin                     |
| gd_heater | guidedog heater output, 0-100, percent.                |
| gd_range  | guidedog heater range 0,1,2,3 for off, low, med, high. |
| gd_p      | guidedog P value                                       |
| gd_i      | guidedog I value                                       |
| gd_d      | guidedog D value                                       |
| spex_ch1  | spex dewar temperature channel 1, kelvin               |
| spex_ch2  | spex dewar temperature channel 2, kelvin               |
| spex_ch3  | spex dewar temperature channel 3, kelvin               |
| spex_ch4  | spex dewar temperature channel 4, kelvin               |
| spex_ch5  | spex dewar temperature channel 5, kelvin               |
| spex_ch6  | spex dewar temperature channel 6, kelvin               |
| spex_ch7  | spex dewar temperature channel 7, kelvin               |
| spex_ch8  | spex dewar temperature channel 8, kelvin               |
+-----------+--------------------------------------------------------+
24 rows in set (0.00 sec)



(Here is a complex example, we will query for the spex_chX data, from a specific time, the data
is grouped and order by timestamp.)


mysql>  SELECT Timestamp, FROM_UNIXTIME(Timestamp) AS Date, GROUP_CONCAT(SensorData ORDER BY SensorID SEPARATOR ' ') AS SensorData 
     FROM Data 
     WHERE (Timestamp > UNIX_TIMESTAMP('2013-03-20 13:00:00'))  AND  (Timestamp < UNIX_TIMESTAMP('2013-03-20 16:00:00'))  
     AND SensorID LIKE 'spex%' 
     GROUP by Timestamp;

 +------------+---------------------+---------------------------------+
 | Timestamp  | Date                | SensorData                      |
 +------------+---------------------+---------------------------------+
 | 1363829302 | 2013-03-20 15:28:22 | 105 117 120 130 143 156 160 174 |
 | 1363829366 | 2013-03-20 15:29:26 | 104 110 126 131 141 154 161 176 |
 | 1363829404 | 2013-03-20 15:30:04 | 109 111 125 139 148 153 168 176 |
 | 1363829464 | 2013-03-20 15:31:04 | 102 117 127 137 142 154 168 172 |
 | 1363829474 | 2013-03-20 15:31:14 | 106 117 128 131 147 151 160 171 |
 | 1363829534 | 2013-03-20 15:32:14 | 103 115 122 139 148 156 166 174 |
 | 1363829594 | 2013-03-20 15:33:14 | 106 119 125 131 149 158 168 172 |
 | 1363829654 | 2013-03-20 15:34:14 | 100 119 122 134 141 152 167 172 |
 | 1363829715 | 2013-03-20 15:35:15 | 106 116 122 139 141 159 161 172 |
 | 1363829775 | 2013-03-20 15:36:15 | 101 117 125 137 149 154 169 179 |
 | 1363829835 | 2013-03-20 15:37:15 | 108 115 123 139 143 157 162 179 |
 | 1363829895 | 2013-03-20 15:38:15 | 104 112 120 139 149 157 163 171 |
 | 1363829955 | 2013-03-20 15:39:15 | 104 118 125 139 140 158 167 171 |
 | 1363830015 | 2013-03-20 15:40:15 | 107 115 120 135 145 159 168 174 |
 | 1363830075 | 2013-03-20 15:41:15 | 101 112 121 137 146 153 161 174 |
 | 1363830136 | 2013-03-20 15:42:16 | 101 118 124 130 149 158 166 177 |
 | 1363830263 | 2013-03-20 15:44:23 | 106 117 129 131 140 158 165 178 |
 | 1363830287 | 2013-03-20 15:44:47 | 107 117 129 134 148 155 167 176 |
 | 1363830347 | 2013-03-20 15:45:47 | 105 114 120 137 144 150 163 178 |
 | 1363830440 | 2013-03-20 15:47:20 | 103 116 125 136 142 151 166 176 |
 | 1363830466 | 2013-03-20 15:47:46 | 105 111 122 139 145 155 160 176 |
 | 1363830526 | 2013-03-20 15:48:46 | 102 117 122 133 142 159 163 175 |
 | 1363830587 | 2013-03-20 15:49:47 | 106 114 120 139 141 156 169 170 |
 | 1363830647 | 2013-03-20 15:50:47 | 106 116 121 134 146 151 161 172 |
 | 1363830887 | 2013-03-20 15:54:47 | 108 111 121 133 149 158 163 176 |
 | 1363830947 | 2013-03-20 15:55:47 | 108 110 123 136 142 154 162 170 |
 | 1363831007 | 2013-03-20 15:56:47 | 107 111 121 131 140 157 163 178 |
 | 1363831067 | 2013-03-20 15:57:47 | 102 116 120 131 144 153 167 176 |
 | 1363831127 | 2013-03-20 15:58:47 | 101 113 129 135 147 153 165 177 |
 | 1363831188 | 2013-03-20 15:59:48 | 108 118 129 130 144 156 169 176 |
 +------------+---------------------+---------------------------------+


mysql> exit