error de sintaxis que no me deja crear una tabla en mi base de datos

Andrei Radu:

Así que tengo el siguiente código:

String SQLString = $"CREATE TABLE IF NOT EXISTS `accounts` (" +
                                $"`SQLID` INT(11) NOT NULL AUTO_INCREMENT," +
                                $"`socialClub` VARCHAR(64) NOT NULL DEFAULT \"\"," +
                                $"`userName` VARCHAR(64) NOT NULL DEFAULT \"\"," +
                                $"`Cash` INT(11) NOT NULL DEFAULT `0`," +
                                $"`Level` INT(11) NOT NULL DEFAULT `1`," +
                                $"`Age` INT(11) NOT NULL DEFAULT `0`," +
                                $"`Health` INT(6) NOT NULL DEFAULT `1`," +
                                $"PRIMARY KEY (`SQLID`));";

Y me sale el siguiente error cuando se enciende el servidor:

        MySql.Data.MySqlClient.MySqlException (0x80004005): 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 '`0`,`Level` INT(11) NOT NULL DEFAULT `1`,`Age` INT(11) NOT NULL DEFAULT `0`,`Hea' at line 1
       at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
       at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
       at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
       at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
       at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
Es Yennef:

Usted se está escapando incorrectamente la DEFAULTcláusula. Basta con retirar los acentos abiertos y su consulta es sintácticamente correcta.

Supongo que te gusta

Origin http://43.154.161.224:23101/article/api/json?id=320811&siteId=1
Recomendado
Clasificación