Solved

mysql variable type changing automatically

Posted on 2012-04-02
6
358 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:theGhost_k8
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:
theGhost_k8 earned 500 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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:theGhost_k8
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now