Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I recently made a rather stupid mistake and corrupt my Ubuntu installation. To resolve it, I booted with a live cd and copied the database files over. However, now I have copied the folders from the old installation into the new one, whenever I type "use database_name" it just freezes on this:

mysql> use my_database_name;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

And then freezes without giving the terminal.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

On the first "use" command after login, MySQL scans database, tables and columns name for auto completion. If you have many db, tables it could take a while.

To avoid that, launch your client with the -A option (or --no-auto-rehash)

mysql -uroot -p -A

You could also add the disable_auto_rehash variable in your my.cnf (in the [mysql] section) if you want to disable it completly.


share|improve this answer
Is there a way to do this dynamically without bounce of the MySQL server –  MySQLRockstar Apr 28 at 15:06
disable_auto_rehash is not a server variable but a client variable so it does not need a server reboot. Just add disable_auto_rehash in the [mysql] section in your my.cnf. –  Maxime FOUILLEUL May 8 at 19:53
I think the reason I actually asked this is because the slowness had only just started when I reinstated the database installs. The -A help was actually in my original question. –  Matthew Haworth May 27 at 14:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.