[quote=“rizwan”]"ERROR[5346]: cdr_addon_mysql.c:226 mysql_log: mysql_cdr: Failed to insert into database: (1062) Duplicate entry ‘’ for key 3 "
[/quote]
can you establish the SQL it’s trying to run from a debug log ? then use your favourite MySQL query tool to run the same SQL and see what the result is … i suspect you’ll then see where the problem is. have you changed the structure of a CDR db table ? or modified the values or keys ?
[root@phones root]# mysqld --safe-mode
060807 11:40:29 [ERROR] Fatal error: Please read “Security” section of the manual to find out how to run mysqld as root!
060807 11:40:29 [ERROR] Aborting
060807 11:40:29 [Note] mysqld: Shutdown complete
even i did not change the password.
i amable to login locally using mysql -u root -ppassword.
The mysql error appears to show that the server is running fine and asterisk has no problem sending it sql instructions. In an insert instruction there is a problem since asterisk is trying to send a null value to an as yet unidentified table which has an index which is stopping the append.
You could log in to mysql using the mysql CLI, ‘use’ the asterisk database, do ‘describe’ for each of the tables and check that the report complies with the sql you used to set up the tables in the first place.
Second if you do ‘show indexes from …’ where … is each of the tables in turn, this will show which tables have 3 or more indexes in use, and what they are doing.
i had 5 indexes, out of this 2 indexes are duplicates for the existing indexes, so i deleted indexes started recording the call details, but i have lost cdr details for the last two days…
You might want to check /var/log/asterisk/cdr-csv/Master.csv or whatever directory your install is using to store cdr records in plain vanilla csv format. It is possible that the records you need have been stored here and could be inserted into your mysql with an sql statement.
Are you using an application which establishes indexes on your database, or were these put in manually? Might be as well to find out where those indexes came from.