Error [1146]: table ‘XXXs. Xxx’ doesn’t exist causes and Solutions
When I connect to the database, I don’t enable the default singular representation. Therefore, when the database migration is automatically created, the production represents the plural videos. In fact, when I add, delete, modify, query and call the database, I use the singular form, so I can’t find or create the database table
DB, err = gorm.Open(mysql.Open(dsn), &gorm.Config{
QueryFields: true, //print sql
SkipDefaultTransaction: true, //Disabling mysql transactions
NamingStrategy: schema.NamingStrategy{
SingularTable: true, // Use singular table names
},
})
In order to avoid, I change it into singular form
//Automatic creation of video links tableVideo
DB.AutoMigrate(&model.Video{})
Similar Posts:
- MySQL Reading table information for completion of table and column names
- mysqldump unknown table ‘column_statistics’
- [Solved] spark Connect hive Error: javax.jdo.JDODataStoreException: Required table missing : “`DBS`” in Catalog “” Schema “”
- MySQL reports an error lock wait timeout exceeded; Try restarting transaction problem solving method
- [Solved] 1146 – Table ‘performance_schema.session_variables’ doesn’t exist
- MySQL Lock Error: Lock wait timeout exceeded [How to Solve]
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
- ERROR 1044 (42000): Access denied for user ‘root’@’localhost’ to database ‘in…
- mysql ERROR 1044 (42000): Access denied for user ‘
- The ‘INFORMATION_SCHEMA.GLOBAL_STATUS’ feature is disabled; see the documentation for …