"\G" failed to work in my navicat console. How do I use "\G" in navicat?
Using \G as a statement terminator to format results in vertical output is a feature of the mysql command line client.
I'm not a Navicat user, but it seems that it supports something they call Form View which is kind of similar.
https://www2.navicat.com/manual/online_manual/en/navicat/linux_manual/FormView.html
Related
I'm trying to add the employee sample database for practicing with MySQL however there's an error since there's a source command and from what I've found it says that MySQL doesn't support this command anymore.
So, how could I add the complete database without any error?
[this is the code line where the source command is called]
SOURCE is one of the mysql client builtin commands. These are recognized by the mysql client, but not by the MySQL Server's SQL parser.
See https://dev.mysql.com/doc/refman/8.0/en/mysql-commands.html
I'm building a tool using Delphi and MySQL to restore a script generated with MySQLDump.
It was supposed to load and execute a SQL file and log any possible errors into a given output file.
I thought about execute the mysql command line and send command lines but i don't know if its possible ou how to do it since I just know how to call mysql using windows cmd and execute a single command line using ShellExecute or CreateProcess
I tried to do it with a single command line but it did'nt logged the errors properly
I tried this:
cmd /c mysql.exe --user root < "C:\restore.sql" > "C:\restore_log.txt"
the content of restore.sql was:
drop database test;
It does execute my script, but on the second attempt it should log "database doesn't exist" but restore_log.txt was empty
It would help if anyone could point the way to call mysql and send multiple lines OR a help with my cmd line to log properly
Anyone can help me?
I don't know what components you've got available to connect to the MySQL db, but using TADOQuery to access SQL Server, I simply load up the queries into a TADOQuery's .SQL property and then call Open or ExecSQL. As long as it's just vanilla SQL that was generated by SQLDump, I'd guess that should work. It's worth a try anyway.
digging more at stackoverflow I found previous answers that helped, the difference is that the output goes to a Memo that I can save to a file.
Thank you all for the help and the insights.
The answers can be found on the following links:
Getting output from a shell/dos app into a Delphi app
How do I run a command-line program in Delphi?
Getting output from a shell/dos app into a Delphi app
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.
Running the following command in a remote login attempt in a MySQL shell.
show variables;
The query only shows the last 50 or so variables out of 233. I would like the result to be scrollable so that I can review all of the variables. Something like a redirect to 'less.'
As it is, I am stumped.
You could try using the following command to set a "less"-type of behavior in the MySQL command line:
pager less
Also, this behavior can be turned off by using this command:
pager
(Note: This might not work on every flavor of MySQL... for more information, check the docs.)
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'