Mysql help

Discussion in 'HTML Basics' started by pat102, Nov 1, 2012.

Tags:
  1. pat102

    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
     
  2. paul

    paul Ninja

    A bigint can only hold numbers
    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).
     
  3. pat102

    pat102 New Member

    Hi Paul,

    Thanks for the reply.
    I have lost all the data, as i have no backup.

    pat102
     
  4. AshlyMoz

    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. :(
     
  5. ziycon

    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!
     

Share This Page