Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11 Can't create nor connect to MySQL on Install #50536

Closed
AllTheUserNamesAreGone opened this issue Mar 13, 2024 · 11 comments
Closed

Laravel 11 Can't create nor connect to MySQL on Install #50536

AllTheUserNamesAreGone opened this issue Mar 13, 2024 · 11 comments

Comments

@AllTheUserNamesAreGone
Copy link

Laravel Version

11.0.2

PHP Version

8.3.3

Database Driver & Version

No response

Description

Trying to install the new Laravel 11 for the first time and can not get it to connect to mysql. Have tried to create the DB manually and it fails and running php artisan migrate, where it asks to create the DB Laravel_11 as it correctly says that it doen't exist and gives:

SQLSTATE[HY000] [1049] Unknown database 'laravel_11' (Connection: mysql, SQL: select table_name as name, (data_length + index_length) as size, table_comment as comment, engine as engine, table_collation as collation from information_schema.tables where table_schema = 'laravel_11' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)

I have set the ENV variables which work fine for Laravel 10 and before. I have tried to create the DB manually and still doesn't work.
Screenshot 2024-03-13 at 20 32 33

Steps To Reproduce

Laravel install Laravel_11

Install Jetstream and Livewire
Add Email verification and Dark

No to run migrations

Pick mysql as DB

@MNhat0308
Copy link

same issue

@subhananam
Copy link

subhananam commented Mar 14, 2024

facing the same issue using PHP 8.2.12 and Laravel 11.0.2 , select breeze using react

Edit found solution in

https://stackoverflow.com/questions/78154387/laravel11-mysql-migration-problem-with-collation-general-error-1273-unknown-c

its about the changing of DB_COLLATION

@crynobone
Copy link
Member

Can you try with the following configuration:

DB_COLLATION=(null)

@driesvints
Copy link
Member

Please fill out your database driver and engine version and don't leave that field blank.

@AllTheUserNamesAreGone
Copy link
Author

Can you try with the following configuration:

DB_COLLATION=(null)

This fixed it for me. Thank you.

@moerphie
Copy link

Same issue, with a slightly different error log:
SQLSTATE[HY000] [2002] Connection refused (Connection: mysql, SQL: select table_name as `name`, (data_length + index_length) as `size`, table_comment as `comment`, engine as `engine`, table_collation as `collation` from information_schema.tables where table_schema = 'laravel_db' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)

@AllTheUserNamesAreGone
Copy link
Author

Please fill out your database driver and engine version and don't leave that field blank.

Please fill out your database driver and engine version and don't leave that field blank.

Mysql - Ver 14.14 Distrib 5.7.39, for osx10.12 (x86_64)

@driesvints
Copy link
Member

This is now fixed with v11.0.6. Thanks everyone.

@cyberfab007
Copy link

Screenshot 2024-05-09 061534
Still getting this error, MySQL latest, Laravel 11 latest, going back to 10

@cyberfab007
Copy link

DB_COLLATION=utf8mb4_unicode_ci
MYSQL_VERSION=latest
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=6033
DB_DATABASE=app_db
DB_USERNAME=root
DB_PASSWORD=my_secret_password

@driesvints
Copy link
Member

That's not the installer? Try a support channel for your issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants