?
Solved

mysql variable type changing automatically

Posted on 2012-04-02
6
Medium Priority
?
402 Views
Last Modified: 2012-08-13
hi
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?
0
Comment
Question by:darien_software
  • 3
  • 3
6 Comments
 
LVL 21

Expert Comment

by:K V
ID: 37795501
well mysql won't change it like this !!
Btw
- 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!
0
 

Author Comment

by:darien_software
ID: 37795628
thanks for reply
can u tell how to check,retrieve binary log file..i am not that kinda dba
0
 
LVL 21

Accepted Solution

by:
K V earned 1500 total points
ID: 37795753
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
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

Author Comment

by:darien_software
ID: 37799533
I want little more help.

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

log_bin=mysql_bin
server_id=10

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.
0
 
LVL 21

Expert Comment

by:K V
ID: 37800708
Check above links for variable names.  [http://dev.mysql.com/doc/refman/5.0/en/replication-options-binary-log.html]
use log-bin.
0
 

Author Comment

by:darien_software
ID: 37815586
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.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question