lower_case_table_names引數設定解決Error Code: 1146. Table doesn't exist?
檢查程式程式碼發現執行SQL :SELECT * FROM Base_User ... 報的錯,但檢查Mysql 5.7.16 for Linux 中table卻存在。
嘗試把SQL中駝峰式表名(Base_User)改為全小寫表名SELECT * FROM base_user可以正常執行,原來是因為Mysql for Linux中預設大小敏感,而windows中預設大小寫不敏感。
在my.cnf設定引數 lower_case_table_names 為1,並重啟mysql後大小寫不敏感
[mysqld]
lower_case_table_names=1
參考文件:
lower_case_table_names
Property | Value |
---|---|
Command-Line Format | --lower-case-table-names[=#] |
System Variable | lower_case_table_names |
Scope | Global |
Dynamic | No |
Type | integer |
Default | 0 |
Minimum | 0 |
Maximum | 2 |
If set to 0, table names are stored as specified and comparisons are case-sensitive.
If set to 1, table names are stored in lowercase on disk and comparisons are not case sensitive.
If set to 2, table names are stored as given but compared in lowercase. This option also applies to database names and table aliases.
On Windows the default value is 1. On OS X, the default value is 2.
You should not set lower_case_table_names to 0 if you are running MySQL on a system where the data directory resides on a case-insensitive file system (such as on Windows or OS X).
It is an unsupported combination that could result in a hang condition when running an INSERT INTO ... SELECT ... FROM tbl_nameoperation with the wrong tbl_name letter case. With MyISAM, accessing table names using different letter cases could cause index corruption.
As of MySQL 5.7.9, an error message is printed and the server exits if you attempt to start the server with --lower_case_table_names=0 on a case-insensitive file system.
If you are using InnoDB tables, you should set this variable to 1 on all platforms to force names to be converted to lowercase.
The setting of this variable in MySQL 5.7 affects the behavior of replication filtering options with regard to case sensitivity.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25583515/viewspace-2151316/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist解決辦法ErrorMySql
- 'mysql.column_stats' doesn't exist and Table 'mysql.index_stats' doesn't existMySqlIndex
- ERROR 1146 (42S02): Table 'mysql.slow_log' doesn't existErrorMySql
- MySQL 啟動報錯 Table 'mysql.plugin' doesn't existMySqlPlugin
- Linux環境下MySQL報Table 'xxx' doesn't exist錯誤解決方法LinuxMySql
- 帝國CMS重新整理資料表article提示Table ‘empirecms.phome_ecms_’ doesn’t exist的解決
- MySQL查詢報錯:ERROR 1146 (42S02): Table 'craw.sitePageConfig' doesn't existMySqlError
- about Res folder doesn't exist in android projectAndroidProject
- SNMP TABLE ERROR : Requested table is empty or does not existError
- [BUG反饋]子查詢報錯,Base table or view not found: 1146 Table 'onethink.(' doesn't existView
- doesn't contain a valid partition tableAI
- MySQL 5.5原始碼安裝時啟動資料庫報錯"Table 'mysql.user' doesn't exist??"MySql原始碼資料庫
- MIRO Error:Table T169V: entry G180 does not existError
- 解決安裝ubuntu系統時出現錯誤:(10, “debian-installer/locale doesn‘t exist“)Ubuntu
- if doesn't support the "condition"attribute 問題解決
- MYSQL ERROR 1146 Table doesnt exist 解析MySqlError
- 解決Error (1133): Can’t find any matching row in the user tableError
- Field ‘spu_id‘ doesn‘t have a default valu 解決辦法
- user management table and t-code
- [ERROR] Can't open the mysql.plugin tableErrorMySqlPlugin
- windows下mysql修改表名大訊息引數lower_case_table_names,需要initialize才生效WindowsMySql
- Processes引數設定引起的故障解決一例
- Android Studio Git No tracked branch configured for branch branch_name or the branch doesn't existAndroidGit
- ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default valueError
- 易優CMS【錯誤程式碼】 SQLSTATE【42S02】:Base table or view not found:1146 Table‘111.ey_admin_theme‘doesn‘t exist-eyoucmsSQLView
- Code::Blocks 編譯引數的相關設定BloC編譯
- scrollTop doesn't scroll on Chrome 61Chrome
- C++ doesn't name a typeC++
- 解決pgpool啟動報錯 ifup[/sbin/ip] doesn't have setuid bitUI
- mysql 大小寫敏感 lower_case_table_namesMySql
- from v * ERROR at line 1: ORA-00942: table or view does not existErrorView
- 安裝mysql遇到ERROR: 1136 Column count doesn't match value count at row 1MySqlError
- Error: The directory named as part of the path ./log/supervisord.log does not exist解決方案Error
- Table 引數總結
- adb server version (31) doesn’t match this client (36); killing… 的解決方法Serverclient
- vsftpd設定引數FTP
- RAC 特定引數設定
- 兩個引數設定