First Backup your Database:
mysqldump -u root -p yourDatabaseName > dumpFileName.sql
Then create a copy of that file and edit it in VIM or your favourite editor:
Search and replace your prefix with the one you want, then Save
Then restore your updated database:
mysqldump -u root -p yourDatabaseName < dumpFileName.sql
Lastly be sure to update your application with the new prefix name, for wordpress this is wp-config.php