我通过 phpMyAdmin 在 mySQL 中执行的所有操作均出现常量 #1064 错误 [英] Constant #1064 error on everything I do in mySQL through phpMyAdmin

查看:19
本文介绍了我通过 phpMyAdmin 在 mySQL 中执行的所有操作均出现常量 #1064 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<块引用>

1064 - 您的 SQL 语法有错误

我刚刚全新安装了 XAMPP,并为 phpMyAdmin 和 mySQL 配置了用户名和密码.到目前为止一切顺利,没有错误并且一切正常.但是当我去创建一个新的数据库,创建一个新表,甚至删除一个表时,它总是出现 #1064 错误消息.

删除数据库时出错:

<块引用>

SELECT MAX( version ) FROM.WHERE db_name = 'new_database_test' ANDtable_name = '' AND FIND_IN_SET( 'DROP DATABASE', tracking ) >0

MySQL 说:

#1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册以了解要使用的正确语法'WHERE db_name = 'new_database_test' AND table_name = '' 附近AND FIND_IN_SET('D' 在第 1 行

创建数据库时出错:

<块引用><块引用>

SQL 查询:编辑

SELECT MAX( version ) FROM.WHERE db_name = 'new_test_db' ANDtable_name = '' AND FIND_IN_SET( 'CREATE DATABASE', tracking ) >0

MySQL 说:

#1064 - 您的 SQL 语法有错误;检查手册对应于您的 MySQL 服务器版本以使用正确的语法靠近 'WHERE db_name = 'new_test_db' AND table_name = '' ANDFIND_IN_SET('CREATE ' 在第 1 行

添加表格时出错:

<块引用>

SQL 查询:编辑

SELECT MAX( version ) FROM.WHERE db_name = 'new_test_db' ANDtable_name = 'awesome_table' AND FIND_IN_SET('CREATE TABLE',跟踪 ) >0

MySQL 说:

#1064 - 您的 SQL 语法有错误;检查手册对应于您的 MySQL 服务器版本以使用正确的语法'WHERE db_name = 'new_test_db' AND table_name = 附近'awesome_table' AND FIND_IN' 在第 1 行

尽管出现错误,但它显示正在创建和删除数据库.但是当我尝试创建一个表时,它只是创建了一个空表,而不是包含我想要的任何列.

有人知道如何解决这个问题吗?我对 mySQL 和 phpMyAdmin 都不熟悉,所以真的不知道从哪里开始.

谢谢.

解决方案

今年,我在我的几个学生的机器上看到了这个问题,当时我正在尝试使用 XAMPP 和 PHPMyAdmin 作为介绍用户教他们一些基本的 SQL界面.

从错误消息看来,PMA 在尝试打开某些表时将无意义的 SQL 附加到 SQL 语句的末尾,即使在侧边栏中单击它们的名称也是如此.

删除数据库并重新创建它没有帮助,不幸的是,我的 Google 搜索没有明显的答案.

在确定问题与 PMA 相关,并且可能与特定于用户的配置相关后,我在 phpmyadmin 数据库中进行了一些挖掘.

我发现在 phpmyadmin.pma_table_uiprefs 中连续附加到查询中的无意义 SQL 将问题与我学生的用户名和特定数据库相关联和给她带来麻烦的表名.大奖!我删除了这一行.

但是,在删除该行后,我尝试关闭并重新启动 Apache、MySQL,甚至我的网络浏览器,但问题仍然存在.直到她的机器完全重新启动,问题才消失.(这是一台 Windows 机器,FWIW,YMMV.)

希望这会有所帮助.

西蒙·鲁伊斯

坎特伯雷

技术

1064 - You have an error in your SQL syntax

I've just done a fresh install of XAMPP and configured the usernames and passwords for phpMyAdmin and mySQL. So far so good, no errors and all working fine. But when I go to create a new database, create a new table, or even drop a table it always comes up with the #1064 Error message.

Error when dropping a database:

SELECT MAX( version ) FROM.WHERE db_name = 'new_database_test' AND table_name = '' AND FIND_IN_SET( 'DROP DATABASE', tracking ) >0

MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE db_name = 'new_database_test' AND table_name = '' AND FIND_IN_SET('D' at line 1

Error when creating a database:

SQL query: Edit

SELECT MAX( version ) FROM.WHERE db_name = 'new_test_db' AND table_name = '' AND FIND_IN_SET( 'CREATE DATABASE', tracking ) >0

MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE db_name = 'new_test_db' AND table_name = '' AND FIND_IN_SET('CREATE ' at line 1

Error when adding a table:

SQL query: Edit

SELECT MAX( version ) FROM.WHERE db_name = 'new_test_db' AND table_name = 'awesome_table' AND FIND_IN_SET( 'CREATE TABLE', tracking ) >0

MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE db_name = 'new_test_db' AND table_name = 'awesome_table' AND FIND_IN' at line 1

Despite the errors it's showing the databases are getting created and dropped. But when I try to create a table it simply creates an empty table instead of including any of the columns I wanted.

Anybody have any idea how to fix this? I'm completely new to both mySQL and phpMyAdmin, so don't really know where to begin.

Thanks.

解决方案

I have seen this problem on a couple of my students' machines, this year, while trying to teach them some basic SQL using XAMPP with PHPMyAdmin as an introductory user interface.

It seemed from the error message that PMA was appending nonsense SQL onto the end of the SQL statements when trying to open certain tables, even when clicking on their name in the sidebar.

Dropping the database and re-creating it didn't help, and unfortunately no obvious answers were forthcoming on my Google search.

After determining that the problem was PMA related, and likely related to user-specific configurations, I did a little digging around in the phpmyadmin database.

I found the nonsense SQL that was being appended to the queries in a row in the phpmyadmin.pma_table_uiprefs which associated the problem with my student's username, and the specific database and table name that was causing her the trouble. Jackpot! I deleted this row.

After deleting that row, though, I tried shutting down and restarting Apache, MySQL, even my web browser, and the problem persisted. It wasn't until a total reboot of her machine that the problem vanished. (This was a Windows machine, FWIW, YMMV.)

Hope this helps.

Simón Ruiz

Canterbury

Technology

这篇关于我通过 phpMyAdmin 在 mySQL 中执行的所有操作均出现常量 #1064 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆