programing

테이블 작성 시 MARIADB 오류 1064(42000)

bestcode 2022. 10. 18. 22:52
반응형

테이블 작성 시 MARIADB 오류 1064(42000)

테이블을 작성하려고 할 때:

MariaDB [heladeria]> create table sabores ('Id_sabores' int NOT
NULL,'sab_nombre' varchar(255) NOT NULL, 'calorias' varchar(255) NOT
NULL, PRIMARY KEY (Id_sabores));

다음의 에러가 표시됩니다.

ERROR 1064 (42000): You have an error
in your SQL syntax; check the manual that corresponds to your MariaDB
server version for the right syntax to use near ''Id_sabores' int NOT
NULL,'sab_nombre' varchar(255) NOT NULL, 'calorias' varchar' at line 1

작은따옴표(')는 오브젝트(이 경우 컬럼) 이름이 아닌 문자열 리터럴을 나타내기 위해 사용됩니다.제거만 하면 됩니다.

create table sabores (
    Id_sabores int NOT NULL,
    sab_nombre varchar(255) NOT NULL, 
    calorias varchar(255) NOT NULL, 
    PRIMARY KEY (Id_sabores)
);

언급URL : https://stackoverflow.com/questions/40800310/mariadb-error-1064-42000-when-create-table

반응형