Solved

mysql variable type changing automatically

Posted on 2012-04-02
6
367 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

829 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