Can't migrate Laravel database

Username (e.g. epiz_XXX) or Website URL

epiz_29379979

Error Message

Illuminate\Database\QueryException
SQLSTATE[42000]: Syntax error or access violation: 1142 REFERENCES command denied to user 'epiz_29379979'@'HIDDEN_IP_ADDRESS' for table 'users' (SQL: alter table `certificates` add constraint `certificates_user_id_foreign` foreign key (`user_id`) references `users` (`id`) on delete cascade on update cascade)

Other Information

I wanted to migrate the database using the Laravel script I made. The Laravel migration file contains the references statement which the database user seems doesn’t have the permission to use it.

Check this out

1 Like

My app could connect to the database and created the tables. The problem is that the MySQL user doesn’t have permission for REFERENCES command which is required by the schema to works.

Looks like this is the case

3 Likes

Thanks for that.

1 Like

Welcome

Maybe @Admin could list the limitation for hosting Laravel apps. The limits that I found was:

ErrorException
symlink() has been disabled for security reasons

This is free hosting and requirements keep changing. Not feasible as others will request for other apps as well

Those are the two main limitations I know of.

A few other things of the top of my head:

  • Can’t run Artisan commands.
  • Can’t run CLI cron jobs (to trigger Artisan commands or use Laravel’s integrated scheduler).
  • Can’t use Queues.
  • No Redis or Memcached for queues, caching, etc.
  • Perhaps some putenv restrictions causing issues with configuration loading, but I’m not sure about that one yet.

These are just the ones I can think of right now. I know web hosting and I know Laravel, but I don’t have perfect understanding of combining the two.

I love Laravel as a framework and it’s great for web applications. It’s just not so great for websites and really wasn’t designed to work within the constraints of traditional web hosting.

3 Likes

Yeah, Laravel is indeed a great framework but maybe only suitable for hosting with VPS or something similiar. So far .env file works great based on my experience. Is there a FAQ section about these limitations? If not, I’m suggesting you to add one so clueless people like me could know. Thanks @Admin for your response.

There is no documentation about running Laravel on our hosting. But I agree that it would be useful to have. I see posts semi-frequently about people wanting to run Laravel here, so having a complete article about it would be helpful.

I’ll make a note to write it.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.