# Can't migrate Laravel database

**URL:** <https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676>\
**Category:** Hosting Support\
**Created:** [August 11, 2021, 12:47am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676 "2021-08-11T00:47:06Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon95504909](https://forum.infinityfree.com/letter_avatar/anon95504909/32/6_449c533f586939b6e5f246632a46421f.png) [@anon95504909](https://forum.infinityfree.com/u/anon95504909)\
**Post date:** [August 11, 2021, 12:47am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/1 "2021-08-11T00:47:06Z")

</div>

### Username (e.g. epiz\_XXX) or Website URL

epiz\_29379979

### Error Message

```auto
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.

 ![image](https://forum-cdn.infinityfree.net/original/3X/3/4/345b351da296d9f67ec44da56f6f8db2dbb15cf9.png)

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [August 11, 2021, 3:17am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/2 "2021-08-11T03:17:06Z")

</div>

Check this out

> [@Common MySQL Connection Errors](https://forum.infinityfree.com/t/common-mysql-connection-errors/49338):
>
> Many websites use MySQL databases to store information and settings. However, there are some reasons why the connection to the database may fail. This article describes some commonly seen error messages when connecting to a database, as well as some general tips to keep in mind when setting up a database connection. Common Error Messages Using MySQL is great, but the error message returned if there is an issue logging in to your database can be quite confusing. Here are some commonly seen error…

---

<div class="post-metadata">

**Author:** ![anon95504909](https://forum.infinityfree.com/letter_avatar/anon95504909/32/6_449c533f586939b6e5f246632a46421f.png) [@anon95504909](https://forum.infinityfree.com/u/anon95504909)\
**Post date:** [August 11, 2021, 3:28am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/3 "2021-08-11T03:28:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [August 11, 2021, 3:34am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/4 "2021-08-11T03:34:27Z")

</div>

Looks like this is the case

> [@Permissions error when creating database](https://forum.infinityfree.com/t/permissions-error-when-creating-database/49114/2):
>
> Hi and welcome to the forum Please speak English (it is the only official language on this forum) I believe the problem is in this

---

<div class="post-metadata">

**Author:** ![anon95504909](https://forum.infinityfree.com/letter_avatar/anon95504909/32/6_449c533f586939b6e5f246632a46421f.png) [@anon95504909](https://forum.infinityfree.com/u/anon95504909)\
**Post date:** [August 11, 2021, 3:40am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/5 "2021-08-11T03:40:34Z")

</div>

Thanks for that.

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [August 11, 2021, 3:42am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/6 "2021-08-11T03:42:31Z")

</div>

Welcome

---

<div class="post-metadata">

**Author:** ![anon95504909](https://forum.infinityfree.com/letter_avatar/anon95504909/32/6_449c533f586939b6e5f246632a46421f.png) [@anon95504909](https://forum.infinityfree.com/u/anon95504909)\
**Post date:** [August 11, 2021, 4:35am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/7 "2021-08-11T04:35:37Z")

</div>

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

- Can’t create foreign key. [Permissions error when creating database - #2 by Oxy](https://forum.infinityfree.com/t/permissions-error-when-creating-database/49114/2)
- Can’t create symbolic link. (Required since most asset that stored in `storage` folder and then added a symbolic link to the `public` folder).

```php
ErrorException
symlink() has been disabled for security reasons

```

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [August 11, 2021, 5:20am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/8 "2021-08-11T05:20:38Z")

</div>

> [@anon95504909](#):
>
> list the limitation for hosting Laravel apps

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

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [August 11, 2021, 9:06am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/9 "2021-08-11T09:06:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon95504909](https://forum.infinityfree.com/letter_avatar/anon95504909/32/6_449c533f586939b6e5f246632a46421f.png) [@anon95504909](https://forum.infinityfree.com/u/anon95504909)\
**Post date:** [August 17, 2021, 12:36am UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/10 "2021-08-17T00:36:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [August 17, 2021, 2:15pm UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/11 "2021-08-17T14:15:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [August 24, 2021, 2:16pm UTC](https://forum.infinityfree.com/t/cant-migrate-laravel-database/49676/12 "2021-08-24T14:16:10Z")

</div>

Closed on August 24, 2021, 2:16pm UTC

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