Support the ongoing development of →
Database Eloquent
Last updated 2 years ago.

SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (migration varchar(255) not n
ull, batch int not null) default character set utf8 collate utf8_unicode_ci)

SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''

This shows that there is error while creating the migration, usually with connection issue.

You see, migration table is always created when we are using migrations.

Have you check the connection string?

I'm guessing you're using MySQL. It's in the root .env file, and search for these lines:

DB_HOST= //or localhost

Then edit the connections accordingly.

Last updated 7 years ago.

DB_HOST= DB_DATABASE=blues_main DB_USERNAME=homestead DB_PASSWORD=secret


stu3881 said:

DB_HOST= DB_DATABASE=blues_main DB_USERNAME=homestead DB_PASSWORD=secret

Try changing with localhost


Hi, I keep suggesting that I've "done something" and it's broken my project. Basically, i had everything pretty much configured correctly and working. I did see that i didn't have a DB_CONNECTION or DB_PORT in .ENV so i added them. I imagine that it doesn't make any difference since i have several working connections defined already in config/database.php.

As a test, i created a new laravel project "l5_blues2". i think this one is 5.3. "blues_main" is my default database. i did a vagrant ssh to get me into homestead and i created the blues_main database using mysql. i opened another and ssh'd into .../code/blues2 I ran php artisan migrate:install and it successfully created the migrations table (YAY!). Then i ran php artisan migrate and it updated the migrations table accordingly. I readded the migrations to the folder in the order they had been loaded originally. php artisan migration:status shows all migrations as complete. Then i went back to my other tab and ran the mysqldump to load just the data from the original mysqldump.

The old app (l5_larablues) reads the database just fine and I'm essentially back in business. And, i have a working backup and recovery of my vm database; however crude.

But, the is not a fix, it's just a recovery.

We can see that laravel detects that he needs to create the migrations table, but where he's getting the name is now blank. That's what i'd like to be able to do.


Sign in to participate in this thread!


Your banner here too?

stu3881 stu3881 Joined 22 Nov 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.