Skip to main content

How to Upgrade Your RAM and SSD on Ubuntu: A Complete Guide 2025 - 2026 midway

laravel php artisan migrate Migrating: 2014_10_12_000000_create_users_table Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))

Sanjay Tech solutions


php artisan migrate
Migrating: 2014_10_12_000000_create_users_table

   Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))




this probles with database drive provider 

i have resolved error with 3 solution 



solution 1

 you need to create database with type " utf8_unicode_ci   "  




solution 2

change in config/database.php file
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
to
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',


solution  3


Add following code to your project file  AppServiceProvider.php (/app/Providers/AppServiceProvider.php)
use Illuminate\Support\Facades\Schema; //NEW: Import Schema

function boot()
{
    Schema::defaultStringLength(191); //NEW: Increase StringLength
}

Comments

Popular posts from this blog

Shopify fully custom contact section block on home page

Tech Easy Solutions Shopify fully custom contact section block on home page <section class="contact-information" >       <!--<div class="left-shape">         <img src="images/left-shape.png" class="img-fluid">       </div>-->       <div class="container c-container">         <div class="row">           <div class="col-lg-6 col-md-6 col-sm-12 col-12">             <div class=" contact-us">                         {% form 'contact' %}                       {% if form.posted_successfully? %}                        <center> <p class="note form-success">                   ...

Fixing PHP 8.2 zip Extension Error on Ubuntu 25 for Laravel 10,11,12 Shopify Apps

Tech Easy Solutions           Solution : How to Fix PHP 8.2 zip Extension Error on Ubuntu 25 Since Ubuntu 25’s PPAs don’t yet support this extension directly, there are three approaches to fix this: server  / local Ubuntu   Compile the Zip Extension from Source (Recommended) Install development packages: $ sudo apt-get install php8.2-dev libzip-dev build-essential unzip Install the zip extension via PECL:  $ sudo pecl install zip Enable the extension:  $ echo "extension=zip.so" | sudo tee /etc/php/8.2/cli/conf.d/20-zip.ini $ echo "extension=zip.so" | sudo tee /etc/php/8.2/fpm/conf.d/20-zip.ini Restart PHP services : $ sudo systemctl restart php8.2-fpm Verify $ :  php -m | grep zip ____________________________________________________ Result :  Error tracer : Why This Error Happens When running a Laravel 12 Shopify project on Ubuntu 25, you might see an error like: php8 .2 - zip : Depends: libzip4t64 (>= 1....

How to delete Torrent power account

Sanjay Tech solutions 3 easy tips to delete torrent power account  Step 1 : login in to your account Step 2 : click on more profile settings Step 3 : you see red button with deactivate account click then enter your password Your account deactivate