Syntax error or access violation: 1064 You have an error in your SQL In symfony












2














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










share|improve this question
























  • 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
















2














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










share|improve this question
























  • 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














2












2








2







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










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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












1 Answer
1






active

oldest

votes


















1














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.






share|improve this answer





















    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    1














    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.






    share|improve this answer


























      1














      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.






      share|improve this answer
























        1












        1








        1






        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 13 '18 at 19:22









        UltimoUltimo

        133




        133






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?