Alex Rivera | Logout

Escaping hyphens with the mysql commandline tool

Asked 2010-10-09T08:32:54.743
12

Is there a way to escape a hyphen with the mysql commandline tool?

I basically need to do this:

mysql  -hlocalhost -uuser -puser information_schema -e  "CREATE DATABASE foo-bar"

Using mysqladmin is not an option due to the framework I'm within.

Edit
Report

1 Answer

21

"CREATE DATABASE \`foo-bar\`"

answered 2010-10-09T08:35:45.077

Your Answer