Mysql help

Status
Not open for further replies.

pat102

New Member
I have a database and one of the fields that was varchar , and I changed it to bigint.

The field contained five or more digits, EG 29sd102

The field is now reading only the first two digits EG 29

Is their anyway to reverse this, or is this permanent.

I have change the field back to varchar with no success, and have no back up

thanks
 

paul

Ninja
A bigint can only hold numbers
Integer (whole number) data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). Storage size is 8 bytes.
so if you changed something to that then it will only be a number. Or you've told MySQL to intrepret that it should only store a number in that filed

So you've probably lost that data, unless you've kept a backup (which you say you don't have).
 

AshlyMoz

New Member
Opps then this is not reversible whenever you try to do some changes to a particular table in a DB please make sure to back it up first before attempting to change it. well unfortunately you wont be able to retrieve the old values. :(
 

ziycon

New Member
Most databases will truncate the data in a column if you change it's size to be smaller then the currently set size. As said before if you don't have a back up the data is lost I'm afraid.

Always take a backup before doing any work on the database, better to be safe!
 
Status
Not open for further replies.
Top