New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Creating MySQL database containing only numbers
ShardHostSarah
Member
in Help
Looking to create a MySQL database from the command line using numbers.
mysql -h ip.addr.es -u root -papassword -e "CREATE DATABASE IF NOT EXISTS 234";
Fails
Yet
mysql -h ip.addr.es -u root -papassword -e "CREATE DATABASE IF NOT EXISTS test";
works.
This discussion has been closed.
Comments
try:
mysql -h ip.addr.es -u root -papassword -e "CREATE DATABASE IF NOT EXISTS
234
"...that's meant to be the database name surrounded by backticks
You should always escape variables in SQL-statements.
That works fine thanks, just need to escape the back ticks in the line also. This can be closed.