Selecting a database in mysql with spaces in its name

前端 未结 6 1444
抹茶落季
抹茶落季 2020-12-10 12:10

I want to select my particular database in mysql console, but the problem is that my database name has a space in between and mysql ignores the part after the space. For ins

6条回答
  •  Happy的楠姐
    2020-12-10 13:13

    You have two options.

    1 Enclose the database name in backticks or single quotes.

    USE `student registration`;
    USE 'student registration';
    

    2 Escape the white space character.

    USE student\ registration;

    Oddly enough this produces.

    ERROR: Unknown command '\ '.

    But still changes the database.

提交回复
热议问题