简体   繁体   English

CAKEPHP SQLSTATE [42S02]:未找到基表或视图:1146 表“cms_database.users”不存在。 我使用 cakephp 4

[英]CAKEPHP SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cms_database.users' doesn't exist. iam using cakephp 4

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cms_database.users' doesn't exist SQLSTATE [42S02]:未找到基表或视图:1146 表“cms_database.users”不存在

Could this be caused by using Auto-Tables?这可能是由使用自动表引起的吗? Some of the Table objects in your application were created by instantiating "Cake\ORM\Table" instead of any other specific subclass.您的应用程序中的某些 Table 对象是通过实例化“Cake\ORM\Table”而不是任何其他特定子类来创建的。

This could be the cause for this exception.这可能是此异常的原因。 Auto-Tables are created for you under the following circumstances:在以下情况下会为您创建自动表:

The class for the specified table does not exist.指定表的 class 不存在。 The Table was created with a typo: $this->getTableLocator()->get('Atricles');该表是用错字创建的: $this->getTableLocator()->get('Atricles'); The class file has a typo in the name or incorrect namespace: class Atricles extends Table The file containing the class has a typo or incorrect casing: Atricles.php The Table was used using associations but the association has a typo: $this->belongsTo('Atricles') The table class resides in a Plugin but no plugin notation was used in the association definition. The class file has a typo in the name or incorrect namespace: class Atricles extends Table The file containing the class has a typo or incorrect casing: Atricles.php The Table was used using associations but the association has a typo: $this->belongsTo ('Atricles') 表 class 驻留在插件中,但在关联定义中未使用插件符号。

Please try correcting the issue for the following table aliases:请尝试更正下表别名的问题:

Users用户

Thanks for your concern..感谢你的关心..

I solved my error..我解决了我的错误..

I place this resolver method code in my Application.php file to change default users table to admins table.我将此解析器方法代码放在我的 Application.php 文件中,以将默认用户表更改为管理员表。 here is the code-这是代码-

$authenticationService->loadIdentifier('Authentication.Password', [
    'fields' => [
        'username' => 'username',
        'password' => 'password',
        
    ],
    
    'resolver' => [
    'className' => 'Authentication.Orm',
    'userModel' => 'Admins',
    ]
]);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQLSTATE [42S02]:未找到基表或视图:1146表X不存在 - SQLSTATE[42S02]: Base table or view not found: 1146 Table X doesn't exist SQLSTATE[42S02]:未找到基表或视图:1146 表 '***.indices' 不存在 laravel - SQLSTATE[42S02]: Base table or view not found: 1146 Table '***.indices' doesn't exist laravel SQLSTATE[42S02]:未找到基表或视图:1146 Laravel 5.2 上不存在表“db_wls.users” - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_wls.users' doesn't exist on laravel 5.2 SQLSTATE[42S02]:未找到基表或视图:1146 表“My_database_Name.posts”不存在 - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'My_database_Name.posts' doesn't exist SQLSTATE [42S02]:在cakephp中找不到基表或视图 - SQLSTATE[42S02]: Base table or view not found in cakephp SQLSTATE [42S02]:找不到基表或视图:1146表'sf_sandbox.phpcr_workspaces'不存在 - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sf_sandbox.phpcr_workspaces' doesn't exist SQLSTATE[42S02]:未找到基表或视图:1146 表 'hr.staff' 不存在 - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'hr.staff' doesn't exist SQLSTATE [42S02]:未找到基表或视图:1146 表“laravel_abonamenty2.currencies”不存在 - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel_abonamenty2.currencies' doesn't exist SQLSTATE[42S02]: 未找到基表或视图:1146 表 'laravel9rentalcars.categories' 不存在 - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel9rentalcars.categories' doesn't exist Laravel-[PDOException] SQLSTATE [42S02]:找不到基本表或视图:1146表'ip.priorities'不存在 - Laravel - [PDOException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ip.priorities' doesn't exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM