Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

keithmichelson's avatar

Database Issues

I'm pushing my app to production using digital ocean and forge. Everything is synced with github and now working but I'm not sure how to run a migration now that it's live to populate my database tables?

Also, I imported my data through sequel pro to just test and I can no longer login or create a user? It just errors out after I submit.

Thanks for any help.

Keith

0 likes
15 replies
taijuten's avatar

You should be able to SSH in, then run your migrations.

Alternatively there's an option to run migrations on deploy. You can change your autodeploy script on forge manually if you'd like to do this.

1 like
taijuten's avatar

You'll also need to set up the environment variables to connect to the db, again on forge. These variables are the same format as in your .env file but the password will have been emailed to you from forge when the server was set up.

olimorris's avatar

Yeah you should just be able to add

php artisan migrate --force

to your deploy script to get Forge to fix migrations

keithmichelson's avatar

Thanks for the replies. I didn't think to ssh in and run them. I do have the auto deploy script running with php artisan migrate --force but nothing shows up in the database.

Thanks.

Keith

keithmichelson's avatar

@taijuten they are set through forge and match the config file. Any other step I might be missing?

Thanks

Keith

keithmichelson's avatar

@taijuten I restarted it through digital ocean, I didn't see where in forge? Tried again same error, also tried that stackoverflow thing and same error. It's really weird.

keithmichelson's avatar

@taijuten Found the problem, I had to add 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock', to the config file to get mamp working a long time ago. I had completely forgotten that was breaking everything.

Thanks again for trying to figure this out.

Keith

taijuten's avatar

Now are your migrations working?

When you say you can't create a user, are you talking MySQL user, or user on your app?

keithmichelson's avatar

Yes they are! I edited that last one, the user registration is working as well, just had an article error. I think I'm good.

Keith

Please or to participate in this conversation.