Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql source, how to find the line number of error?

Tags:

mysql

In mysql, I issue source mysource.sql
ERROR 1064 (42000): 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 '' at line 1
Is there way to get the exact location of the error? Is line 1 really line 1?

the file is large. You can give -1 but I am really looking for a setting or a tool that help in that.

like image 429
Aftershock Avatar asked Feb 25 '23 11:02

Aftershock


1 Answers

Instead of mysql> source mysource.sql # you can use command prompt with --verbose option for more helpful output.

# mysql --verbose test < mysource.sql
like image 61
shantanuo Avatar answered Mar 08 '23 07:03

shantanuo