Syntax error or access violation: 1064 You have an error in your SQL In symfony
When i run comand php bin/console doctrine:migration:migrate
i got this error I don't know where is come from.
command line error :
In AbstractMySQLDriver.php line 99:
An exception occurred while executing 'CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NU
LL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id
)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
In PDOConnection.php line 109:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
In PDOConnection.php line 107:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
My env
my env
symfony symfony4 doctrine-migrations
add a comment |
When i run comand php bin/console doctrine:migration:migrate
i got this error I don't know where is come from.
command line error :
In AbstractMySQLDriver.php line 99:
An exception occurred while executing 'CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NU
LL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id
)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
In PDOConnection.php line 109:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
In PDOConnection.php line 107:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
My env
my env
symfony symfony4 doctrine-migrations
What mysql version are you using? JSON was introduced in MySQL 5.7.
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:48
10.1.25-MariaDB
– Abdo Abo
Nov 18 '18 at 22:50
JSON was added in MariaDB 10.2.7 as per mariadb.com/kb/en/library/json-data-type
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:54
add a comment |
When i run comand php bin/console doctrine:migration:migrate
i got this error I don't know where is come from.
command line error :
In AbstractMySQLDriver.php line 99:
An exception occurred while executing 'CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NU
LL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id
)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
In PDOConnection.php line 109:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
In PDOConnection.php line 107:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
My env
my env
symfony symfony4 doctrine-migrations
When i run comand php bin/console doctrine:migration:migrate
i got this error I don't know where is come from.
command line error :
In AbstractMySQLDriver.php line 99:
An exception occurred while executing 'CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NU
LL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id
)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
In PDOConnection.php line 109:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
In PDOConnection.php line 107:
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'JSON NOT NULL, password VARCHAR(255)
NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C7' at line 1
My env
my env
symfony symfony4 doctrine-migrations
symfony symfony4 doctrine-migrations
edited Nov 18 '18 at 23:30
A.L
7,10984069
7,10984069
asked Nov 18 '18 at 22:44
Abdo AboAbdo Abo
1214
1214
What mysql version are you using? JSON was introduced in MySQL 5.7.
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:48
10.1.25-MariaDB
– Abdo Abo
Nov 18 '18 at 22:50
JSON was added in MariaDB 10.2.7 as per mariadb.com/kb/en/library/json-data-type
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:54
add a comment |
What mysql version are you using? JSON was introduced in MySQL 5.7.
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:48
10.1.25-MariaDB
– Abdo Abo
Nov 18 '18 at 22:50
JSON was added in MariaDB 10.2.7 as per mariadb.com/kb/en/library/json-data-type
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:54
What mysql version are you using? JSON was introduced in MySQL 5.7.
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:48
What mysql version are you using? JSON was introduced in MySQL 5.7.
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:48
10.1.25-MariaDB
– Abdo Abo
Nov 18 '18 at 22:50
10.1.25-MariaDB
– Abdo Abo
Nov 18 '18 at 22:50
JSON was added in MariaDB 10.2.7 as per mariadb.com/kb/en/library/json-data-type
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:54
JSON was added in MariaDB 10.2.7 as per mariadb.com/kb/en/library/json-data-type
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:54
add a comment |
1 Answer
1
active
oldest
votes
Andrei is right. You either have to upgrade your database or (much easier) config your symfony to use the lower Version of MySQL.
config/packages/doctrine.yaml
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.6'
here you can find a table with the compatibilitys of MySQL and MariaDB.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53366186%2fsyntax-error-or-access-violation-1064-you-have-an-error-in-your-sql-in-symfony%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Andrei is right. You either have to upgrade your database or (much easier) config your symfony to use the lower Version of MySQL.
config/packages/doctrine.yaml
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.6'
here you can find a table with the compatibilitys of MySQL and MariaDB.
add a comment |
Andrei is right. You either have to upgrade your database or (much easier) config your symfony to use the lower Version of MySQL.
config/packages/doctrine.yaml
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.6'
here you can find a table with the compatibilitys of MySQL and MariaDB.
add a comment |
Andrei is right. You either have to upgrade your database or (much easier) config your symfony to use the lower Version of MySQL.
config/packages/doctrine.yaml
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.6'
here you can find a table with the compatibilitys of MySQL and MariaDB.
Andrei is right. You either have to upgrade your database or (much easier) config your symfony to use the lower Version of MySQL.
config/packages/doctrine.yaml
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.6'
here you can find a table with the compatibilitys of MySQL and MariaDB.
answered Dec 13 '18 at 19:22
UltimoUltimo
133
133
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53366186%2fsyntax-error-or-access-violation-1064-you-have-an-error-in-your-sql-in-symfony%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What mysql version are you using? JSON was introduced in MySQL 5.7.
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:48
10.1.25-MariaDB
– Abdo Abo
Nov 18 '18 at 22:50
JSON was added in MariaDB 10.2.7 as per mariadb.com/kb/en/library/json-data-type
– Andrei Dumitrescu-Tudor
Nov 18 '18 at 22:54