You can create geometry object using three ways:
- WKT Functions
- WKB Functions
- Using MySQL-Specific Functions
This example inserts a MultiLineString value using WKT:
mysql> CREATE TABLE t1 (g geometry);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t1 VALUES (GeomFromText('MULTILINESTRING(
'> (837673.49483448 897799.87646918, 0 0),
'> (838780.86205188 897369.23366241, 0 0),
'> (839170.49125801 897164.16565918, 0 0),
'> (839970.25647058 896651.49565112, 0 0),
'> (840542.51994158 895979.67802725, 0 0)
'> )'));
Query OK, 1 row affected (0.01 sec)
mysql> SELECT AsText(g) FROM t1;
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| AsText(g) |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| MULTILINESTRING((837673.49483448 897799.87646918,0 0),(838780.86205188 897369.23366241,0 0),(839170.49125801 897164.16565918,0 0),(839970.25647058 896651.49565112,0 0),(840542.51994158 895979.67802725,0 0)) |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
Please follow this manual section for further information:
http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html