Forums

Simple USE statement with MySQL Workbench failing

Hello,

This should be simple. I am connected fine to MySQL through SSH but for some reason the simple command

Assuming my user name is joesmith and my database is joes-data-base...

use joesmith$joes-data-base;

Fails with: 15:53:58 use joesmith$joes-data-base Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-data-base' at line 1 0.041 sec

Anyone have any ideas what.I am doing wrong? I really don't like MySQL on many levels and am tempted heavily to go back to Postgres.

Seems like I need to escape the dash, but not seeing any docs to this solution.

You need to put the database name in backticks (`) if you use special characters like '-' in the name.

Never thought dashes were all that special. Just my opinion. :)

Not something I had to do with MSSQL or Postgres at least. Thanks though, that did the trick.