How to set up an Asterisk ODBC data source on Linux: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
3. Setup /etc/odbc.ini | 3. Setup /etc/odbc.ini | ||
<pre>[ | The name of the section between [] becomes the name of the ODBC connection. The other values should be customized as required, in particular the DATABASE should contain the name of the database to connect to. | ||
<pre>[connection_name] | |||
Description = your text | Description = your text | ||
Trace = Off | Trace = Off | ||
Line 25: | Line 27: | ||
PORT = 3306 | PORT = 3306 | ||
DATABASE = database_name</pre> | DATABASE = database_name</pre> | ||
4. Test the connection | |||
USER and PASSWORD should be substituted with the correct credentials to access the database specified in /etc/odbc.ini | |||
<pre>isql connection_name USER PASSWORD</pre> |
Revision as of 20:09, 11 June 2016
These steps were tested on Centos 6.3
1. Install unixODBC and mysql ODBC connector
yum install unixODBC mysql-connector-odbc
2.Check that /etc/odbcinst.ini should contain something like the following for mysql
[MySQL] Description = ODBC for MySQL Driver = /usr/lib/libmyodbc5.so Setup = /usr/lib/libodbcmyS.so Driver64 = /usr/lib64/libmyodbc5.so Setup64 = /usr/lib64/libodbcmyS.so FileUsage = 1
3. Setup /etc/odbc.ini
The name of the section between [] becomes the name of the ODBC connection. The other values should be customized as required, in particular the DATABASE should contain the name of the database to connect to.
[connection_name] Description = your text Trace = Off TraceFile = stderr Driver = MySQL SERVER = localhost PORT = 3306 DATABASE = database_name
4. Test the connection
USER and PASSWORD should be substituted with the correct credentials to access the database specified in /etc/odbc.ini
isql connection_name USER PASSWORD