Show Procedure error MYSQL - mysql

Is there an error in this code SHOW PROCEDURE CODE proc_name?
The MySQL documentation says it's correct, but I keep receiving a 1064 error anytime I run the code.

This statement is a MySQL extension that is available only for servers that have been built with debugging support.
So, obviously your mysql does not have debugging enabled
because error 1064 stand for parse error.
To enable debug in mysql, is quite straightforward :-
http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_debug
provide mysql is configured --with-debug

You can get your informations from here:
SELECT ROUTINE_DEFINITION FROM information_schema.ROUTINES WHERE SPECIFIC_NAME='proc_name'

Related

Error code: 1064 in MySQL when create SOURCE?

I want to use my SQL'book_data2' file from the desktop E drive as a 'SOURCE'. But I am getting an error code 1064 in MySQL workbench. Could you help me for that issue? I am giving the code and action output below.
Code:
SOURCE E:\DataPractice\Practice\book_data2.sql;
Action Output:
Error Code: 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 'SOURCE E:\DataPractice\Practice\book_data2.sql' at
line 1 0.000 sec
There are a number of commands that are supported by the mysql client (that is, the command-line client, not MySQL Workbench), but they are parsed in the client, not sent to the server as SQL statements. The MySQL Server does not recognize these commands.
It can be confusing, but remember both the client and the server may process commands. You just have to read the documentation to learn which commands are in the list of client-only commands:
https://dev.mysql.com/doc/refman/8.0/en/mysql-commands.html
(Except USE, which is recognized by both mysql client and server, just to make sure there's an exception to every rule!)
If you want to use MySQL Workbench to "source" an SQL file, in other words load a file, read the SQL commands in that file, and execute them, Workbench does support this action, but they call it Data Import/Restore. It's documented here: https://dev.mysql.com/doc/workbench/en/wb-admin-export-import-management.html

calling mysql in perl breaks the --tee option? [duplicate]

Can anyone help me with this? I am currently trying to write my queries to a file and I will eventually close it with notee; call. I have used the tee call before but for some reason today I am having problems.
Here is the syntax in question:
tee c:/trash/test.txt;
select*from customer;
Here is the Error:
Error
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem.
ERROR: Unknown Punctuation String # 6
STR: :/
SQL: tee c:/trash/test.txt;tee c:/trash/test.txt;tee c:/trash/test.txt;
SQL query:
tee c:/trash/test.txt;
MySQL said: Documentation
#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 'tee c:/trash/test.txt' at line 1
The file trash has been created so I know that is not the issue.
Any help will be appreciated thank you.
The tee and notee commands are only available in the MySQL command-line client. They are not handled by the server, so they cannot be used in applications like phpMyAdmin.

'Syntax Error' when using Database Navigator for PyCharm

I have a project with a MySQL database to which I connected using the Database Navigator plugin.
Now when I open the DB Browser window, select the database and click on "Open DB console" and insert the query
SELECT CAST('2017-08-29' AS DATE);
for one, the IDE highlights CAST as an unknown identifier:
and, additionally, when I try to execute the statement, I get the error
Error executing SELECT statement. 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 - Connection: test: 112ms
However, to my knowledge, this is valid MySQL, at least this page suggests so.
I am also able to perform MySQL queries with casts from a python script that builds the connection itself.
What am I doing wrong here? Do I have to configure the dialect for Database Navigator?

MySql - Enable stored procedure feature access using --with-debug in Windows

I'm using MySql commandline 5.6.11 and when I try to see my stored procedure in the command line like
SHOW PROCEDURE CODE sp_my_procedure
I'm getting:
ERROR 1289 (HY000): The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working
How do I use the command to run mysql with "--with-debug" in Windows (I saw the documentation but it talks about how to do that in Linux)?
You need to compile your mysql binary by yourself, see http://dev.mysql.com/doc/refman/5.6/en/source-installation.html, because of
SHOW PROCEDURE CODE proc_name
This statement is a MySQL extension that is available only for servers
that have been built with debugging support.
But maybe SHOW CREATE PROCEDURE gives you what you want.

Import database backup return #1064

Suddenly importing database backup returns the error below.
The odd thing is that importing an old working copy it works.
If I export it straight afterwards and I try to re-import it the file gives this error.
Looks like it's PhpMyAdmin export that causes issue.
Is there any change in PhpMyAdmin export process that I'm not aware of?
This looks like my problem but the solution didn't work for me.
There is a chance that you may have found a bug in the SQL parser.
Please examine your query closely, and check that the quotes are
correct and not mis-matched. Other possible failure causes may be
that you are uploading a file with binary outside of a quoted text
area. You can also try your query on the MySQL command line interface.
The MySQL server error output below, if there is any, may also
help you in diagnosing the problem. If you still have problems or
if the parser fails where the command line interface succeeds, please
reduce your SQL query input to the single query that causes problems,
and submit a bug report with the data chunk in the CUT section below:
----INIZIO CUT----
eNo1jU0KwjAYRIXuvlPMAWIw0SrNLoTQLvJn0roXF1IQ3Sjo7U0FZ/UYHjM255gVjICRcDYoCEgI
QWWsdUPkP+XoFFou+L5b3x5XmkpGLAy6t2FkONkq+vMFZsjR22puuOwoea2wq9xSGtJisViWnS0X
B7j5/nqT06FXmJ/0u6Bm9c8XSs4hPQ==
----FINE CUT----
----INIZIO RAW----
ERROR: C1 C2 LEN: 1 2 11
STR: MySQL: 5.1.69-log
USR OS, AGENT, VER: Mac CHROME 5.0.29
PMA: 4.0.5
PHP VER,OS: 5.3.17 Linux
LANG: it
SQL:
----FINE RAW----
Query SQL:
Messaggio di MySQL:
#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 '' at line 1
(I translated what I could in the error as my phpmyadmin is in Italian)
I had the same problem and I found the solution. Open the sql document with any code editor and at the very end in the last line you will see some black strange codes just delete and save should work as it worked for me.
I'm not sure how and why this code been generated when I exported my database.
You are running an outdated phpMyAdmin version. I believe that the fix mentionned in https://sourceforge.net/p/phpmyadmin/bugs/4095/ (for the upcoming 4.0.8 version) will help you.
Direct link to the fix (can be applied to 4.0.7): https://github.com/phpmyadmin/phpmyadmin/commit/b717657de77db0b58179bdbdd88e23d0fc3d7ea6