Question

SQLSTATE[22023]: invalid parameter value 7 Error:

I am currently trying to migrate my db to my project but I am getting this error but unsure of how to resolve this. It is a laravel project version 7.3 and I am using the new app feature on DigitalOcean.

invalid value for parameter "client_encoding": "utf8mb4" 
(SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE').

Please can anyone help?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
July 25, 2021
Accepted Answer

Hi there,

If you are using the DigitalOcean App Platform along with a Dev Database, keep in mind that the Dev Database is PostgreSQL and not MySQL.

What you would need to do is either to create a separate MySQL Managed Database Cluster or specify in your environment variables that the DB_CONNECTION as pgsql.

Here is a good video demo on how to deploy a Laravel App to the DigitalOcean App Platform:

Hope that this helps! Regards, Bobby

KFSys
Site Moderator
Site Moderator badge
July 26, 2021

Hi @emegwalio,

This indeed looks like Postgresql is being used as Database instead of MySql.

You have two options the way I see it. The first one is in your config/database.php file, edit the

'default' => env('DB_CONNECTION', 'pgsql')

Notice the pgsql at the end.

Or the second option is to set the DB_CONNECTION in .env as pgsql just as already mentioned.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.