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.
"CREATE DATABASE \`foo-bar\`"
Using backticks and using this way of piping the statement to mysql works:
echo 'create database `foo-bar2`' | mysql -uuser -ppassword
// John
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With