Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the DEBUG option to get traces

Status
Not open for further replies.

comadreja

Programmer
Apr 14, 2003
8
ES
Hello, im using the Mysql-3.23.57 and i have a big problem. I want to get the trace of a query, but i don´t know how to use the debug command. When i launch the server i do this:
shell>./safe_mysqld --user=mysql &
and then
shell>./mysql -p
always working as root.
I´ve tried adding the "--debug" option, but it doesn´t seem to work.
Please, i reaaly need some advice.
Thank you and happy summer!
 
I have never used debug, but I tested it on Solaris and it appeared to work. You can just tee the output to a text file.

Code:
bash-2.05$ mysql --debug
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 29 to server version: 4.0.11-gamma-max

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> \u test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from a;
a '' 3 11 1 32768 0
b '' 254 1 1 0 0

Code:
+------+------+
| a    | b    |
+------+------+
|    1 | z    |
|    3 | c    |
|    2 | x    |
+------+------+
3 rows in set (0.00 sec)

abombss
 
But what i need is to get the Mysql trace, i mean, the list of functions that were used and the values of the variables. I know there is an option that you can use when you launch the mysqld, then you star working with the mysql prompt and when you finish there should be a file with the extension "trace" with all the functions ,chronologically ordered, that were used.

Anyway, thank you very much, abombss
 
You need to download the debug release, or compile the server with the the #DEBUG option.

Debug is very slow because of the execessive logging that is done, that is why it is a seperate download... I think.

abombss
 
I´ve tried the debug option (./safe_mysqld --user=mysql --debug &) and it seems to do fine, but when i look for the trace file and i can`t find it anywhere, even using the linux´s search engine. I´ve also tried --debug=/tmp/ and --#, as it is said in the tutorial, but i´m not able to make the debug works.
I´ve also checked the Mysql website but i didn´t find anything that could solve my problem.

Once more, thank you very much, abombss, i owe you a drink.
 
There is a compile time option that must be switch on in the source code before building the server to enable debugging. You need to be running a debug version of the software, not a production release. You can download a new debug versions from MySQL.

Also, there is no startup option "debug" for mysqld, at least not on my server. The client has one though.

Read the download page at MySQL.

abombss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top