Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Creating MySQL database containing only numbers
New on LowEndTalk? Please Register and read our Community Rules.

Creating MySQL database containing only numbers

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.

Comments

  • udkudk Member
    edited August 2013

    try:
    mysql -h ip.addr.es -u root -papassword -e "CREATE DATABASE IF NOT EXISTS 234"

  • udkudk Member

    ...that's meant to be the database name surrounded by backticks

  • skaska Disabled

    You should always escape variables in SQL-statements.

    Make:something
  • edited August 2013

    @udk said:
    ...that's meant to be the database name surrounded by backticks

    That works fine thanks, just need to escape the back ticks in the line also. This can be closed.

This discussion has been closed.