3

I tried to check the time the queries take and tried in phpMyAdmin

SET profiling = 1

did some queries and then

SHOW profiles

but there were no results.

Then I found here http://dev.mysql.com/doc/refman/5.0/en/show-profile.html riiight at the bottom, that only the "Community Server" version is supported with this command.

I am using Mamp and have a 5.5.29 "Source Distribution" version.

How can I get ALL query times in the phpMyAdmin console? (I mean, I cannot alter the php code in every place.) Thanks!!

Edit
Found this here of how to evolve on command line and be sure to have the mysql> of MAMPand not the OS X one.

loveNoHate
  • 1,549
  • 13
  • 21
  • The problem is more likely the `SET profiling = 1` is per session. Every other connection has another session, every page refresh is another session. You also shouldn't need it site wide normally. Write some specific tests with typical usage, set it to on, and read the output. Or if you want to know the data from specific queries, use the cli client (or any client which keeps a session) rather then phpmyadmin. – Wrikken Dec 05 '13 at 21:04
  • @Wrikken Hi, thanks. I overtook the development of a site with nearly medium-sized tables like 21000 entries. The site is slow. I want to know if it MySQL dependent at all and if `index` would be to avail. Could you go deeper into the session thing? All I found was, that they are build upon client, not call!?! And any recommended links for the cli client on Mac? – loveNoHate Dec 05 '13 at 21:12
  • Well, a slow query log would tell you more already, `explain` those queries first. And the mysql command line client? Just use `mysql` from the command line and start typing queries. – Wrikken Dec 05 '13 at 21:18
  • @Wrikken You mean the terminal? I am not sure if I have the Mamp server if I do this. Also I get `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)` when I type `mysql`? – loveNoHate Dec 05 '13 at 21:22
  • Use the same username, password and host you would use in your PHP application. [how to set these and other options are in the documentation](http://dev.mysql.com/doc/refman/5.6/en/mysql.html) – Wrikken Dec 05 '13 at 21:26
  • I found this here: http://blog-en.mamp.info/2009/08/using-mysql-command-line-with-mamp.html. Thanks for now!! I will see how far I come and come back if not. ;) – loveNoHate Dec 05 '13 at 21:36

2 Answers2

6

In phpMyAdmin, when you have the results of a query, just tick the "Profiling" checkbox; the profiling results and chart will show up. Works fine in a source distribution too.

Marc Delisle
  • 8,879
  • 3
  • 29
  • 29
0

I have faced the same issue of my profile not showing my actual executed queries. Here is what I have got and it worked like a charm for me.

You might need to login to the MySQL console from the below path F:\wamp64\bin\mysql\mysql8.0.27\bin - This is my folder you can select your path

Here open the cmd line and login to your MySQL console using the below command

mysql -u root[your username] -p

enter password hit enter

You are now login to MySQL, now select the database in which you have to execute the query. Once you execute the query fire the query show profiles; You will get your last executed query in the table with time and all.

Oops, one step we forget to mention that before doing this please enable profiling in MySQL. You can do that from here https://prnt.sc/XprPxgRlP1Jp

Hope this may help you out.

Atmiya Kolsawala
  • 475
  • 4
  • 12