Table doesn#39;t exist after CREATE TABLE(CREATE TABLE 后表不存在)
问题描述
我正在尝试在我的数据库名称 symfony 中导入此 sql
I'm trying to import this sql in my database name symfony
CREATE TABLE IF NOT EXISTS ingredient (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
我明白了
#1146 - Table 'symfony.ingredient' doesn't exist
这似乎很奇怪,因为我在这里尝试创建这个表,所以......为什么它不起作用?如果我尝试,我会遇到同样的问题
This seems rather odd since i'm trying here to CREATE this table, so... why is it not working ? I've got the same problem if i try
CREATE TABLE symfony.ingredient
或者symfony 2中的特性
Or the feature in symfony 2
c:DevSymfony>php app/console doctrine:schema:create
PS:我只有新版本的xampp才有这个问题.
PS: I have this problem only with the new version of xampp.
编辑
嗯,我设法解决了我的问题.我删除了我的数据库,然后创建了一个(不是使用界面),最后我重新启动了 mysql 服务.我不知道为什么以及如何让我感到困惑,但我希望这会对某人有所帮助.
Well, i somehow managed to solve my problem. I dropped my database, then created one (not with the interface) and finally i restarded mysql service. I don't know why and how it unstuck me, but i hope this will help someone.
推荐答案
我也遇到了同样的问题.我的解决方案:在创建表查询中更改表名,执行它,然后重命名表.
I had the same problem. My solution: Change table name in the create table query, exequte it and then rename the table.
然后,您也可以删除此表并在创建它之后不会出错.
Then, you can also drop this table and after it create it without getting error.
这篇关于CREATE TABLE 后表不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:CREATE TABLE 后表不存在


- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- SQL 临时表问题 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01