• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

mysql variable type changing automatically

i have changed a variable type from into 10 to varchar
but after few days i find it changed back to int10 without anyone intervention

other variables type in the same table which i did the change before or as it is ..
my Q here is
1.did mysql change it automatically..?any bug doing it or any of my code is doing i out?
2.is there a log to find when it changed or did the change at what time and date?
  • 3
  • 3
1 Solution
K VDatabase ConsultantCommented:
well mysql won't change it like this !!
- do anyone other than you have access to it?
- what operations you do with table? Do you load some dumps or restore from somewhere?

You can check binary logs to see if there is any alter table syntaxes logged!
darien_softwareAuthor Commented:
thanks for reply
can u tell how to check,retrieve binary log file..i am not that kinda dba
K VDatabase ConsultantCommented:
Execute below queries on mysql prompt:
show global variables like 'log%bin';
show global variables like 'datadir';

If 1st returns ON, that means you've binary logs enabled. goto your data-directory at path specified by above query.
on system prompt execute:
mysqlbinlog binlogfilename > tempfile.txt

Read more: http://dev.mysql.com/doc/refman/5.0/en/binary-log.html
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

darien_softwareAuthor Commented:
I want little more help.

I am trying to set the binary logging by making changes to my.cnf file as follows


After that I have restarted the server and I have executed the following command.

show global variables like 'log%bin';

But the out put is OFF.

Then how to start the binary logging.
K VDatabase ConsultantCommented:
Check above links for variable names.  [http://dev.mysql.com/doc/refman/5.0/en/replication-options-binary-log.html]
use log-bin.
darien_softwareAuthor Commented:
Now the binary logging is enabled.
But I am unable to view the content of the binary file using the mysqlbinlog utility.

The name of the binary log file is mysql-bin.000001

when I am running the mysqlbinlog utility to view the content of the binary log file. It is throwing sql syntax error. I am not finding any solution.

I am using it following way.

mysqlbinlog mysql-bin.000001; -----not working.

mysqlbinlog mysql-bin.000001 > a.txt;

both are not working  and giving the error as follows

ERROR 1064(42000) : you have an error in sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near
mysqlbinlog mysql-bin.000001.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now