简体   繁体   English

使用Mysql将表导入数据库时​​出现SQL语法错误

[英]Getting SQL syntax error while importing table into database using Mysql

I am getting the following error while trying to import the table into database using MySQL on my Ubuntu machine. 尝试在Ubuntu计算机上使用MySQL将表导入数据库时​​出现以下错误。

Error: 错误:

ERROR 1064 (42000): You have an error in your SQL syntax; 错误1064(42000):您的SQL语法有错误; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u root -p spesh db_hit_type < /var/www/html/spesh.com/public_html/portal/' at line 1 检查与您的MySQL服务器版本相对应的手册,以在第1行的'mysql -u root -p spesh db_hit_type </var/www/html/spesh.com/public_html/portal/'附近使用正确的语法

I was using the following command to import the table data. 我正在使用以下命令来导入表数据。

mysql -u root -p spesh db_hit_type < /var/www/html/spesh.com/public_html/portal/js/db_hit_type.sql;

I think that you try to run this command in MySQL command promt or in some client program. 我认为您尝试在MySQL命令提示符或某些客户端程序中运行此命令。 You need to run mysql program from server console, not from mysql console. 您需要从服务器控制台而不是mysql控制台运行mysql程序。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM