我已经在本地创建了一个蛋糕解决方案,并将其上传到我的托管提供商的环境中。它运行MySQL。我可以完全访问各个数据库,但当然不能访问MySQL主数据库。如果我正确地理解了这种情况,在相同的环境中会有多个数据库被其他客户端在不同的域上使用,这是我永远不会看到的。提供程序已经禁用了在PHPMyAdmin中管理用户权限的能力。通过一个管理面板,我能够创建一个被授予插入、更新、选择和删除权限的用户。但是,使用appl_local.php中指定的数据源参数,当我试图通过user / add页面向数据库添加一个新用户时,我会得到下面的消息。出于安全考虑,我在下面的代码中用星号标记了用户的名字。
。
2021-01-07 10:39:00 Error: [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user '******'@'localhost' for table 'users' in /home/multigra/domains/multi-grade.nl/public_html/content/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php on line 39
'default' => [
'host' => 'localhost',
/*
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
'port' => '3306',
'username' => '******',
'password' => '******',
'database' => '******',
/**
* If not using the default 'public' schema with the PostgreSQL driver
* set it here.
*/
//'schema' => 'myapp',
/**
* You can use a DSN string to set the entire configuration
*/
'url' => env('DATABASE_URL', null),
],发布于 2021-01-07 13:08:38
这是我结束时的一次高调。为了了解数据在不同数据库中传播时如何指定数据库,我对信息的位置做了过多的说明。因为生产环境连接到不同的数据库,所以根本找不到请求的表。“拒绝给用户‘*’@‘localhost’for table‘user’的SELECT命令”没有指出这个方向。我以为这是许可问题。相反,在数据库中找不到表,这就是SELECT语句失败的原因。
https://stackoverflow.com/questions/65611519
复制相似问题