Hello, I'm a newbie in Laravel, what I want to do is set two users wich I'm gonna create in my database, the user1 gonna have the permission to create, delete, update, and select, and the user2 gonna have the permission to alter, delete, create new tables, I mean to manage the migrations mostly. Anyone here already do the same, or something similar?
#How can I set two users for a MySQL database with different permisions?
1 messages · Page 1 of 1 (latest)
You can define an additional db connection in the config which uses the credentials with extra privileges. Then Laravel will use the limited connection by default, and when you run migration commands, you will have to add --database=privileged-connection.
I'm curious why you want to do this though. Usually the default db connection has GRANT ALL on the schema it uses.