View difference between Paste ID: PG37B5eP and C93SKtX8
SHOW: | | - or go back to the newest paste.
1
//isql output
2
echo "select 1" | isql -v asterisk-connector asterisk asteriskmysql
3
+---------------------------------------+
4
| Connected!                            |
5
|                                       |
6
| sql-statement                         |
7
| help [tablename]                      |
8
| quit                                  |
9
|                                       |
10
+---------------------------------------+
11
SQL> +---------------------+
12
| 1                   |
13
+---------------------+
14
| 1                   |
15
+---------------------+
16
SQLRowCount returns 1
17
1 rows fetched
18
19
20
//part of the res_odbc.conf at /etc/asterisk
21
22
[asterisk]
23
;
24
; Permit disabling sections without needing to comment them out.
25
; If not specified, it is assumed the section is enabled.
26
enabled => yes
27
;
28
; This value should match an entry in /etc/odbc.ini
29
; (or /usr/local/etc/odbc.ini, on FreeBSD and similar systems).
30
dsn => asterisk-connector
31
;
32
; Username for connecting to the database.  The default user is "root".
33
username => asterisk
34
;
35
; Password for authenticating the user to the database.  The default
36
; password is blank.
37
password => asteriskmysql
38
;
39
; Build a connection at startup?
40
pre-connect => yes
41
42
43
//cat /etc/unixODBC/odbc.ini
44
[asterisk-connector]
45
Description = MySQL connection to 'asterisk' database
46
Driver = MySQL
47
Database = asterisk
48
Server = localhost 
49
;UserName = asterisk
50
USER = asterisk
51
Password = asteriskmysql
52
Port = 3306
53
;location varies
54
;Socket = /var/lib/mysql/mysql.sock
55
Socket=/var/run/mysql/mysql.sock
56
57
//cat /etc/unixODBC/odbcinst.ini
58
[PSQL]
59
Description             = PostgreSQL
60
Driver          = /usr/lib/psqlodbcw.so
61
UsageCount              = 1
62
63
[MySQL]
64
Description = ODBC for MySQL
65
;Driver = /usr/lib/odbc/libmyodbc.so
66
Driver=/usr/lib/libmyodbc5.so
67
;Setup = /usr/lib/odbc/libodbcmyS.so
68
FileUsage = 1
69
70
//odbc shows nothing!!
71
oquisuse*CLI> odbc show
72
73
ODBC DSN Settings
74
-----------------
75
76
//asterisk is running under username asterisk with the right password
77
78
mysql -u asterisk -p
79
Enter password: 
80
Welcome to the MySQL monitor.  Commands end with ; or \g.
81
Your MySQL connection id is 1
82
Server version: 5.5.25-log Source distribution
83
84
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
85
86
Oracle is a registered trademark of Oracle Corporation and/or its
87
affiliates. Other names may be trademarks of their respective
88
owners.
89
90
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
91
92
mysql>