我正在使用postgresql 15
我尝试运行这些命令
grant all privileges on database my_database to my_database_user;
grant all privileges on all tables in schema public to my_database_user;
grant all privileges on all sequences in schema public to my_database_user;
grant all privileges on all functions in schema public to my_database_user;
但是当我运行
php artisan migrate --seed
时,我得到了以下错误信息:
SQLSTATE[42501]: 权限不足:7 ERROR: 在字符14处拒绝访问模式public (SQL: create table "migrations" ("id" serial primary key not null, "migration" varchar(255) not null, "batch" integer not null))
我缺少什么?
我确保.env文件中的凭据是正确的。
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=my_database
DB_USERNAME=my_database_user
DB_PASSWORD=password
我检查了一下
postgres=# \du my_database_user
List of roles
Role name | Attributes | Member of
-------------+------------+-----------
my_database_user | | {}
并且
postgres=# SELECT * FROM pg_roles;
rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolconnlimit | rolpassword | rolvaliduntil | rolbypassrls | rolconfig | oid
---------------------------+----------+------------+---------------+-------------+-------------+----------------+--------------+-------------+---------------+--------------+-----------+-------
my_database_user | f | t | f | f | t | f | -1 | ******** | | f | | 16389
ALTER DATABASE my_database OWNER TO my_database_user;
- emrdev