Is here a way to check if there is already a log file where mysql is writing general logs?
I'm trying to start my sql with command: --general-log-file="" to see what kind of queries are being sent to the server but that command is not working.
check for log_output
If the value is NONE log entries are not written even if the logs are enabled. If the logs are not enabled, no logging occurs even if the value of log_output is not NONE.
if it is not None then check for log file name using this file_name
Related
I'm a new beginner about Mysql
When I initialize the database after executing an exe files, inserting data cannot be executed
Then I print a general log and try to find why, the insert statement is shown below and there is no detailed error information
enter image description here
However I check the error-log, there is no related information, and I try to run the same insert statement in command line and it can be executed.
So I want to why is it? Or at least let me know is there any error information
Thanks
Here is the code to open genral log in my.init:
log-bin=mysql-bin
binlog_format=mixed
log-output=FILE
general-log=1
I am trying to view the MySQL binlog files to trace down the source of a particular query. I used the SHOW BINARY LOGS query to get the names of the existing log files, but when trying to access using the mysqlbinlog command, I keep getting an error: "File 'xxxx' not found (Errocode: 2 "No such file or directory")".
I also tried accessing the file using the full path /mysql/binlog/mysql-bin/file-name and with double forward slashes and back slashes, but just got the same error. I tried a couple of different files, all gave the same error.
If anyone can explain what I am doing wrong, that would be appreciated.
Mysqlbinlog utility checks your local file system, in this case. For remote server connection, you should use the --read-from-remote-server option in your command line. You can read related detail on the "4.6.8 mysqlbinlog — Utility for Processing Binary Log Files" page.
What is the command in mysql that is required to that I can implement aborted connections and access-denied logs to be written to the syslog?
The commands are first to see what your settings are:
select ##general_log; -- a 1 indicates it is turned on for capture
select ##general_log_file; -- the file that it logs to
select ##datadir; -- directory location where the log lives
To turn logging on for the General Query Log, use the following:
SET GLOBAL general_log = 'ON'; -- 0 is off, 1 is on
Note that the datadir is read-only and requires a restart of the server after changes. Basically, don't change this. It is the home of your database schemas.
For expanded connection failures perform a
select ##log_warnings; -- make a note of your prior setting
set global log_warnings=2; -- setting above 1 increases output
The immediate above relates to the Error log written out in the same datadir.
See the Percona article Auditing login attempts in MySQL and my prior answer Here.
I am not looking for the workarounds . I eager about knowing what the possible reasons could be
You can try the following found at this link which worked for me: http://www.emreakkas.com/windows-tips/solution-manager-of-pid-file-quit-without-updating-file
If you are getting this error when you try to start mysql server, mysql is having a problem with one of the variables that you have in its configuration file my.cnf.
Manager of pid-file quit without updating file
First verify that this is true. Rename my.cnf to my.old.cnf and try starting the server again. If you do not know where my.cnf is, you can do “locate my.cnf”.
If mysql server starts fine when you rename my.cnf, it confirms that it is having a problem with your my.cnf file. Rename the file back to its original name and try starting the server. Once you get the “Manager of pid-file quit without updating file” error message, head to the mysql error log. This error log may be under your system’s log directory (/var/log/mysql) or under the mysql data folder (usually /usr/local/mysql/data). Tail the file to see the problem.
Recently, I have observed the below statement in the master server's MySQL error log many number of times.
"started bin_log dump to slave server"
I would like to know all the possible cases of when exactly this will be logged in the error log.
How connection failure between master and slave will impact this to be logged into the error log.
I suspect personally when we hit "START SLAVE" on the slave server, But it is not as I tested this.
Thanks in advance.
Exact message is this: Start binlog_dump to slave_server
In the source code this string is saved in the logfile when this function is called: mysql_binlog_send
With a bit of research, I see that just before this function is called, changes the slave state to this: Requesting binlog dump and in the MySQL reference manual says that this state is set just when the slave connects with the master.
So, exactly, this message appears when the slave connects with the master.
So it seems that the slave loses connection with the master and then reconnects.
Is this and error or not? I suspect "started bin_log dump to slave server" is not the entire log line if it is an error. Please add an actual snippet from the log in question of the repeating notice.
If replication looks like its working fine, this isn't an error. Non- errors such as servers start and stopping and slave connection status get logged to the MySQL error log. You can override the default logging levels to lower how much and what gets logged:
http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html
Look at the --log-warnings configuration option
I suspect this occurs when you change a slave to a master or when a slave server restarts and try's to reestablish a connection.
I meet the same condition like that
160615 15:40:25 [Note] Start binlog_dump to slave_server(1401), pos(mysql-bin.000020, 219311193)
160622 15:56:58 [Note] Start binlog_dump to slave_server(1401), pos(mysql-bin.000046, 350644600)
when i stop the slave, and start slave again ,the master's mysql error logs would print the note log.
This is nothing to be care. It just means that the slave server (server id is 1401) is begin to connect the master.
Need to be noted that if your masters' mysql error log prints the note log frequently. you will check :
whether the network is stable
if the master have one more slaves ,check the slaves whether have the same server-id.
that's all.