Cant connect to odbc

ODBC DSN Settings

Name: astcdr
DSN: astcdr
Last fail connection attempt: 2024-03-13 02:14:05
Number of active connections: 0 (out of 1)
Logging: Disabled

isql -v asterisk
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect

here is my odbc.ini
Description = MySQL connection to database
Driver = MySQL
Database = cdr
Server = localhost
User = root
Password = ###
Port = 3306
Socket = /var/run/mysqld/mysqld.sock

here is my odbcinst.ini
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/
Setup = /usr/lib/x86_64-linux-gnu/odbc/
FileUsage = 1

and this is what i finally added at the end of res_odbc.conf
enabled => yes
dsn => astcdr
username => root
password => ###
pre-connect => yes

(please help me out where i went wrong as i am a beginner thanks in advance…)

Is your odbc.ini file missing the [ square brackets ] for the DSN ?

Does the DSN match throughout (is it astcdr or is it asterisk ?)

thanks for responding…
i managed to debug the error … yes the square bracket was one of the issues other was that the libmyodbc8a driver was not working so i switched to mariadb connector