Programmer here, be gentle.

I'm working in a MySQL database with only a single table, as shown by show tables:

mysql> show tables;
| Tables_in_widget_web |
| widget_signups       |
1 row in set (0.00 sec)

At some point earlier in development there might have been other tables as well, but for what we were doing we decided that we were probably over-architecting and nixed them.

I noticed the other day that auto-complete within mysql was not working properly in this database. When I am using the particular database and I type SELECT * FROM widget<TAB> I wasn't getting my good old auto-complete that I was used to. Double tabbing to see possible auto-completions yields:

mysql> SELECT * FROM widget<TAB><TAB>
[... columns on widget_signups ...]

Yet when I try to DROP this mysterious and previously deleted widget_date table, I predictably get errors saying the table doesn't exist.

My question is this: how can I repair my beloved mysql auto-complete by removing this phantom table? I would assume (wrongly?) that auto-complete suggestions within the mysql command line are drawn from a table within mysql. Where can I go to zap this safely - or do I just need to man up and get used to typing the entire table name?

  • Is widget_date the name of one of your table columns, perchance?
    – Philᵀᴹ
    Jan 16 '13 at 15:39
  • It is, but it shows up in the omitted portions [... columns on widget_signups ...] as widget_signup.widget_date
    – chucksmash
    Jan 16 '13 at 15:42
  • Thought as much. The auto-complete isn't context aware, thus causing the issue that's distressing you :)
    – Philᵀᴹ
    Jan 16 '13 at 15:44
  • Ahhhhhhh. That makes perfect sense. Make it an answer?
    – chucksmash
    Jan 16 '13 at 15:45

This is happening because the auto-complete isn't context aware & it's offering you a column name of widget_date as well as the table name you're expecting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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