Usando o log flush, o MySQL parece não funcionar, embora eu tenha o privilégio?

1

Um pouco de informação:

select current_user: 
[email protected]

show grants for current_user(): 
'GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY PASSWORD 'omitted'

Service string:
"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini" MySQL

Basicamente, não vejo novos arquivos. Os dois arquivos (.log e server_name.log) continuam crescendo e nenhuma ocorrência de * -old aparece.

O que estou fazendo de errado?

    
por TekiusFanatikus 18.08.2011 / 20:28

1 resposta

1

FLUSH LOGS no MySQL afeta apenas os logs binários.

De acordo com este excerto do MySQL Docs :

Closes and reopens all log files. If binary logging is enabled, the sequence number of the binary log file is incremented by one relative to the previous file. On Unix, this is the same thing as sending a SIGHUP signal to the mysqld server (except on some Mac OS X 10.3 versions where mysqld ignores SIGHUP and SIGQUIT).

If you execute FLUSH LOGS and mysqld is writing the error log to a file (for example, if it was started with the --log-error option), log file renaming occurs as described in Section 5.2.1, “The Error Log”.

IMHO, como DBA do MySQL nestes últimos 7 anos, eu pessoalmente nunca vi esse trabalho em logs de erro, mas apenas logs binários.

Nos últimos documentos do MySQL sobre o MySQL 5.5 :

If you flush the logs using FLUSH LOGS or mysqladmin flush-logs and mysqld is writing the error log to a file (for example, if it was started with the --log-error option), the effect is version dependent:

As of MySQL 5.5.7, the server closes and reopens the log file. To rename the file, you can do so manually before flushing. Then flushing the logs reopens a new file with the original file name. For example, you can rename the file and create a new one using the following commands:

shell> mv host_name.err host_name.err-old
shell> mysqladmin flush-logs
shell> mv host_name.err-old backup-directory

On Windows, use rename rather than mv.

Prior to MySQL 5.5.7, the server renames the current log file with the suffix -old, then creates a new empty log file. Be aware that a second log-flushing operation thus causes the original error log file to be lost unless you save it under a different name. On Windows, you cannot rename the error log while the server has it open before MySQL 5.5.7. To avoid a restart, flush the logs first to cause the server to rename the original file and create a new one, then save the renamed file. That also works on Unix, or you can use the commands shown earlier.

No error log renaming occurs when the logs are flushed in any case if the server is not writing to a named file.

Mais uma vez, repito, pessoalmente nunca vi esse trabalho em logs de erros, mas apenas registros binários.

Os clientes do meu empregador têm esse script bash.

    
por 19.08.2011 / 20:24

Tags