#1064-you have a syntax error in your SQL near 'DEFAULT CHARACTER SET utf8 COLLATE utf8 general ci' on Line 1 [closed]

closed. this question is out of scope and is not currently accepting answers.

want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 9 months ago .

improve this question

So guys, I exported a school database where I study only that I exported the bank from an old mysql so it generates another xml code for me and I need to import it to a mysql latest he da this error 1046 has any way to run it in current mysql?Come again?

Code error:

Erro

Análise estática:

1 1 erros foram encontrados durante a análise.

    Era esperado o nome da entidade. (near "DEFAULT CHARACTER SET" at position 31)

Query SQL:

CREATE DATABASE IF NOT EXISTS DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

Mensagem do MySQL: Documentação
#1064 - Você tem um erro de sintaxe no seu SQL próximo a 'DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci' na linha 1
Author: Adriano Rufino, 2019-08-28

1 answers

Missed you put the name of your database....

CREATE DATABASE IF NOT EXISTS MinhaDataBase DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

To run on your most current MySQL just give a name to the DATABASE you are creating.

 1
Author: Matheus Ribeiro, 2019-08-28 13:28:38