<small id='kvhxU'></small><noframes id='kvhxU'>

      1. <legend id='kvhxU'><style id='kvhxU'><dir id='kvhxU'><q id='kvhxU'></q></dir></style></legend>
          <bdo id='kvhxU'></bdo><ul id='kvhxU'></ul>
        <i id='kvhxU'><tr id='kvhxU'><dt id='kvhxU'><q id='kvhxU'><span id='kvhxU'><b id='kvhxU'><form id='kvhxU'><ins id='kvhxU'></ins><ul id='kvhxU'></ul><sub id='kvhxU'></sub></form><legend id='kvhxU'></legend><bdo id='kvhxU'><pre id='kvhxU'><center id='kvhxU'></center></pre></bdo></b><th id='kvhxU'></th></span></q></dt></tr></i><div id='kvhxU'><tfoot id='kvhxU'></tfoot><dl id='kvhxU'><fieldset id='kvhxU'></fieldset></dl></div>

      2. <tfoot id='kvhxU'></tfoot>

        Laravel 中的 mariaDB JSON 支持

        mariaDB JSON support in Laravel(Laravel 中的 mariaDB JSON 支持)

            <small id='BfZEd'></small><noframes id='BfZEd'>

            • <i id='BfZEd'><tr id='BfZEd'><dt id='BfZEd'><q id='BfZEd'><span id='BfZEd'><b id='BfZEd'><form id='BfZEd'><ins id='BfZEd'></ins><ul id='BfZEd'></ul><sub id='BfZEd'></sub></form><legend id='BfZEd'></legend><bdo id='BfZEd'><pre id='BfZEd'><center id='BfZEd'></center></pre></bdo></b><th id='BfZEd'></th></span></q></dt></tr></i><div id='BfZEd'><tfoot id='BfZEd'></tfoot><dl id='BfZEd'><fieldset id='BfZEd'></fieldset></dl></div>

              1. <tfoot id='BfZEd'></tfoot>
                <legend id='BfZEd'><style id='BfZEd'><dir id='BfZEd'><q id='BfZEd'></q></dir></style></legend>
                  <bdo id='BfZEd'></bdo><ul id='BfZEd'></ul>
                    <tbody id='BfZEd'></tbody>
                  本文介绍了Laravel 中的 mariaDB JSON 支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 XAMP 中创建一个 json 数据库,在使用 phpmyAdmin 时它显示我正在使用 mariaDB,但在我的 xamp-control panel v3.2.2 中它显示正在运行 mySQL 在端口 3306 上.我正在使用 Laravel 5.4 框架来创建数据库,以下是我正在尝试执行的迁移:

                  I'm trying to create a json database in XAMP, while using the phpmyAdmin it showed me that I'm using mariaDB but in my xamp-control panel v3.2.2 it shows running mySQL on port 3306. I'm using Laravel 5.4 framework to create the database, following is my migration which I'm trying to execute:

                  Schema::connection('newPortal')->create('pages', function (Blueprint $table){
                      $table->increments('id');
                      $table->string('title');
                      $table->string('slug')->unique()->index();
                      $table->json('styles')->nullable();
                      $table->json('content')->nullable();
                      $table->json('scripts')->nullable();
                      $table->softDeletes();
                      $table->timestamps();
                  });
                  

                  现在执行此操作时出现以下错误:

                  Now while executing this I'm getting following error:

                  SQLSTATE[42000]:语法错误或访问冲突:1064 您的 SQL 语法有错误;查看与您的 MariaDB 服务器版本相对应的手册,了解在 'json null, content json null, scripts json null, deleted_at 第 1 行的时间戳 null'(SQL:创建表 pages (id int unsigned not null auto_increment 主键,title varchar(191) notnull, slug varchar(191) not null, styles json null, content json null, scripts json null,deleted_at timestamp null, created_at timestamp null, updated_at timestamp null) 默认字符集 utf8mb4 collate utf8mb4_unicode_ci)

                  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 null, content json null, scripts json null, deleted_at timestamp null' at line 1 (SQL: create table pages (id int unsigned not null auto_increment primary key, title varchar(191) not null, slug varchar(191) not null, styles json null, content json null, scripts json null, deleted_at timestamp null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)

                  即使我保持不为空,它也会抛出相同的错误.我想要 json 格式的数据,我检查了支持的版本,并根据文档 json 格式支持从版本 MariaDB 10.0.16. 开始,我正在使用 10.1.21-MariaDB

                  Even if I keep not null it throws the same error. I want to have json formatted data, I checked the supported version and as per the documentation json format support started from the version MariaDB 10.0.16. and I'm using 10.1.21-MariaDB

                  帮我解决这个问题.

                  推荐答案

                  MariaDB 10.2.7 版本开始;JSON 数据类型是 LONGTEXT 的别名.

                  Since MariaDB version 10.2.7; theJSON data-type is an alias for LONGTEXT.

                  如果您对 MariaDB 中的 JSON 数据类型有疑问,只需将其更改为 LONGTEXT.;-)

                  If you are having issues with the JSON data-type in MariaDB, simply just change it to LONGTEXT. ;-)

                  或者使用 这个包

                  这篇关于Laravel 中的 mariaDB JSON 支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <tfoot id='JJ2xy'></tfoot>

                  <i id='JJ2xy'><tr id='JJ2xy'><dt id='JJ2xy'><q id='JJ2xy'><span id='JJ2xy'><b id='JJ2xy'><form id='JJ2xy'><ins id='JJ2xy'></ins><ul id='JJ2xy'></ul><sub id='JJ2xy'></sub></form><legend id='JJ2xy'></legend><bdo id='JJ2xy'><pre id='JJ2xy'><center id='JJ2xy'></center></pre></bdo></b><th id='JJ2xy'></th></span></q></dt></tr></i><div id='JJ2xy'><tfoot id='JJ2xy'></tfoot><dl id='JJ2xy'><fieldset id='JJ2xy'></fieldset></dl></div>
                    <tbody id='JJ2xy'></tbody>
                • <legend id='JJ2xy'><style id='JJ2xy'><dir id='JJ2xy'><q id='JJ2xy'></q></dir></style></legend>

                      <small id='JJ2xy'></small><noframes id='JJ2xy'>

                          • <bdo id='JJ2xy'></bdo><ul id='JJ2xy'></ul>