Syntax error or access violation: 1305 FUNCTION

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Error:-

local.ERROR: SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION professnow_bangaloreorbit.ANY_VALUE does not exist (SQL: select `city`, ANY_VALUE(poster) AS poster, COUNT(*) AS cities from `events` where (`publish` = 1 and `status` = 1) and (`events`.`publish` = 1 and `events`.`status` = 1) group by `city` order by `cities` desc limit 6) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION professnow_bangaloreorbit.ANY_VALUE does not exist (SQL: select `city`, ANY_VALUE(poster) AS poster, COUNT(*) AS cities from `events` where (`publish` = 1 and `status` = 1) and (`events`.`publish` = 1 and `events`.`status` = 1) group by `city` order by `cities` desc limit 6) at /home/professnow/public_html/orbit/bangaloreorbit.com/events/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712)
[stacktrace]

Solution:-

Step 1:- Go inside your laravel project.

Step 2:- Open the File named database.php which is present in the Config Directory. config/database.php

Step 3:- Right now when you are facing this Syntax error or access violation: 1305 FUNCTION issue you code is :

'mysql' => [
    'driver' => 'mysql',
    'host' => env('DB_HOST', 'localhost'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_DATABASE', 'forge'),
    'username' => env('DB_USERNAME', 'forge'),
    'password' => env('DB_PASSWORD', ''),
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
    'strict' => True,
    'engine' => null,
],

Step 4:- Change the ‘strict’ => True, to ‘strict’ => false, which looks like this

'mysql' => [
    'driver' => 'mysql',
    'host' => env('DB_HOST', 'localhost'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_DATABASE', 'forge'),
    'username' => env('DB_USERNAME', 'forge'),
    'password' => env('DB_PASSWORD', ''),
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
    'strict' => false,
    'engine' => null,
],

Step 5:- Save and close the file.

Step 6:- Run the Config:Clear command

php artisan config:clear

Your Issue will be solved.

Senior Software Development Engineer at Cotocus

Related Posts

How We Fixed a Stubborn Laravel MeiliSearch Bulk Indexing Failure (16,000+ Records)

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now If…

Read More

Laravel Search Without Docker, Queues, or Horizon

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Modern…

Read More

Laravel Scout with Typesense vs Meilisearch

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Modern…

Read More

SESSION_DRIVER=file vs SESSION_DRIVER=database in Laravel

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Which…

Read More

Laravel Logging: Complete Step-by-Step Guide to Enable, Debug, Verify, and Master Logs in Any Laravel Project

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Logging…

Read More

Complete Tutorial: Setting Up Laravel Telescope Correctly (Windows + XAMPP + Custom Domain)

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now This…

Read More
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments