18 | | Simply specifying the OGR DSN in the CONNECTION statement of your LAYER definition proved successful. |
| 19 | For MySQL Specifically, the DSN should be formatted as: |
| 20 | {{{ |
| 21 | MYSQL:##DATABASE##,host=##HOST##,user=##USERNAME##,pass=##PASSWORD##,tables=##TABLE##,##TABLE##,##TABLE## |
| 22 | }}} |
| 23 | |
| 24 | === Step 2: Test your DSN === |
| 25 | After creating your DSN, test it using the utility `ogrinfo`. |
| 26 | |
| 27 | {{{ |
| 28 | ogrinfo -ro -al MYSQL:##DATABASE##,host=##HOST##,user=##USERNAME##,pass=##PASSWORD##,tables=##TABLE## -sql 'SELECT geom FROM ##TABLE##' |
| 29 | }}} |
| 30 | |
| 31 | === Step 3: Edit your mapfile === |
| 32 | |
| 33 | After testing and verifying that OGR can connect and display your data in MySQL, you can drop your DSN and Data statement right into your mapfile. Specify the '''CONNECTIONTYPE''' as '''OGR'''. |