I have been looking a while for a solution to the problem to rebuild Drupal menus until I stumbled upon a Drupal issue that helped me. My solution (in a php script) is the following:
db_query("DELETE FROM {menu_links} WHERE module = 'system'");
db_query("DELETE FROM {menu_links} WHERE menu_name = 'management'");
menu_rebuild();
This could also be done by entering the queries through phpmyadmin or something alike:
DELETE FROM {menu_links} WHERE module = 'system'
DELETE FROM {menu_links} WHERE menu_name = 'management'
And then rebuilding the menu structure. If you use the devel module, you can achieve that by visiting the page /devel/menu/reset
. I you don't have the devel module, I'm not sure how to rebuild the menu structure.
Don't forget to backup your database before you try this.