title: Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;
body: <p>I want to migrate my database using laravel.<br>
  I try this command: <code>php artisan migrate:fresh --seed</code> and take this error:  </p>
  
  <pre><code>Migrating: 2019_10_28_130723_alter_users_table
  
     Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB ser
  ver version for the right syntax to use near 'CHARACTER SET utf8mb4 DEFAULT 0 NOT NULL COLLATE `utf8mb4_unicode_ci`' at line 1 (SQL: ALTER TABLE users CHANGE deductible_amount deductible_a
  mount BIGINT UNSIGNED CHARACTER SET utf8mb4 DEFAULT 0 NOT NULL COLLATE `utf8mb4_unicode_ci`)
  
    at C:\xampp\htdocs\project\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
      660|         // If an exception occurs when attempting to run a query, we'll format the error
      661|         // message to include the bindings with SQL, which will make this exception a
      662|         // lot more helpful to the developer instead of just the database's errors.
      663|         catch (Exception $e) {
    &gt; 664|             throw new QueryException(
      665|                 $query, $this-&gt;prepareBindings($bindings), $e
      666|             );
      667|         }
      668|
  
    Exception trace:
  
    1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB s
  erver version for the right syntax to use near 'CHARACTER SET utf8mb4 DEFAULT 0 NOT NULL COLLATE `utf8mb4_unicode_ci`' at line 1")
        C:\xampp\htdocs\project\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:63
  
    2   PDOException::("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 'CHARACTER SET utf8mb4 DEFAULT 0 NOT NULL COLLATE `utf8mb4_unicode_ci`' at line 1")
        C:\xampp\htdocs\project\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:61
  
    Please use the argument -v to see more details.
  
  </code></pre>
  
  <p>Here is the content of my <code>2019_10_28_130723_alter_users_table</code> migration file:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class AlterUsersTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::table('users', function (Blueprint $table) {
              $table-&gt;renameColumn('active', 'is_active');
              $table-&gt;dropColumn([
                                      'settings',
                                      'google_id',
                                      'github_id',
                                      'telegram_notif',
                                      'income',
                                      'email_notif',
                                      'sms_notif',
                                      'temppass',
                                      'storm_id',
                                 ]);
              $table-&gt;unsignedBigInteger('deductible_amount')-&gt;change();
              $table-&gt;softDeletes();
          });
      }
  
  
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::table('users', function (Blueprint $table) {
              $table-&gt;renameColumn('is_active', 'active');
              $table-&gt;text('settings');
              $table-&gt;string('google_id')-&gt;nullable();
              $table-&gt;string('github_id')-&gt;nullable();
              $table-&gt;boolean('telegram_notif')-&gt;default(true);
              $table-&gt;string('income')-&gt;nullable();
              $table-&gt;boolean('email_notif')-&gt;default(true);
              $table-&gt;boolean('sms_notif')-&gt;default(false);
              $table-&gt;string('temppass')-&gt;nullable();
              $table-&gt;string('storm_id')-&gt;default(null)-&gt;nullable();
              $table-&gt;string('deductible_amount')-&gt;after('wallet')-&gt;default('0')-&gt;change();
              $table-&gt;dropSoftDeletes();
          });
      }
  }
  </code></pre>
  
  <p>I don't know how to resolve this problem. I have searched for it, but most of the answers are mentioning a <code>json</code> field which must be converted to <code>string</code>, which there is no <code>json</code> field on my <code>users</code> table.
  Where is the problem and how can I solve that?</p>