powered by simpleCommunicator - 2.0.41     © 2025 Programmizd 02
Форумы / MySQL [игнор отключен] [закрыт для гостей] / Как узнать, какие запросы приходят в серверу MySQL ?
2 сообщений из 2, страница 1 из 1
Как узнать, какие запросы приходят в серверу MySQL ?
    #32022651
Mulder
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
т.е. как вести лог запросов, если это вообще возможно
...
Рейтинг: 0 / 0
Как узнать, какие запросы приходят в серверу MySQL ?
    #32023870
Фотография mahoune
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Вроде как можно!
Опять возвращаемся к документации по MySQL

---- MySQL Documentation ----
G.1.5 Using log files to find cause of errors in mysqld
Note that before starting mysqld with --log you should check all your tables with myisamchk. See section 4 MySQL Database Administration.

If mysqld dies or hangs, you should start mysqld with --log. When mysqld dies again, you can examine the end of the log file for the query that killed mysqld.

If you are using --log without a file name, the log is stored in the database directory as 'hostname'.log In most cases it's the last query in the log file that killed mysqld, but if possible you should verify this by restarting mysqld and executing the found query from the mysql command line tools. If this works, you should also test all complicated queries that didn't complete.

You can also try the command EXPLAIN on all SELECT statements that takes a long time to ensure that mysqld is using indexes properly. See section 5.2.1 EXPLAIN Syntax (Get Information About a SELECT).

You can find the queries that take a long time to execute by starting mysqld with --log-slow-queries. See section 4.9.5 The Slow Query Log.

If you find the text mysqld restarted in the error log file (normally named `hostname.err') you have probably found a query that causes mysqld to fail. If this happens you should check all your tables with myisamchk (see section 4 MySQL Database Administration), and test the queries in the MySQL log files to see if one doesn't work. If you find such a query, try first upgrading to the newest MySQL version. If this doesn't help and you can't find anything in the mysql mail archive, you should report the bug to mysql@lists.mysql.com. Links to mail archives are available online at the MySQL documentation page.

If you have started mysqld with --with-myisam-recover, MySQL will automatically check and try to repair MyISAM tables if they are marked as 'not closed properly' or 'crashed'. If this happens, MySQL will write an entry in the hostname.err file 'Warning: Checking table ...' which is followed by Warning: Repairing table if the table needs to be repaired. If you get a lot of these errors, without mysqld having died unexpectedly just before, then something is wrong and needs to be investigated further. See section 4.1.1 mysqld Command-line Options.

It's of course not a good sign if mysqld did died unexpectedly, but in this case one shouldn't investigate the Checking table... messages but instead try to find out why mysqld died.
---- MySQL Documentation ----
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / MySQL [игнор отключен] [закрыт для гостей] / Как узнать, какие запросы приходят в серверу MySQL ?
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]