patternsqlMajor
MySQL database freezing after 'use'
Viewed 0 times
afterdatabasemysqlfreezinguse
Problem
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:
And then freezes without giving the terminal.
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 -AAnd then freezes without giving the terminal.
Solution
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)
You could also add the disable_auto_rehash variable in your my.cnf (in the [mysql] section) if you want to disable it completely. This change does not require a reboot (it is a client, not server, variable).
To avoid that, launch your client with the -A option (or --no-auto-rehash)
mysql -uroot -p -AYou could also add the disable_auto_rehash variable in your my.cnf (in the [mysql] section) if you want to disable it completely. This change does not require a reboot (it is a client, not server, variable).
Code Snippets
mysql -uroot -p -AContext
StackExchange Database Administrators Q#62102, answer score: 36
Revisions (0)
No revisions yet.