Thursday, July 06, 2006

Downgrade Mysql 5.0 to 4.1

เฮอๆ พอจะ downgrade แล้วจะเจอปัญหาดังนี้ครับ

Unpacking mysql-server-4.1 (from .../mysql-server-4.1_4.1.15-1ubuntu5_i386.deb) ...
Aborting downgrade from (at least) 5.0 to 4.1.
dpkg: error processing /var/cache/apt/archives/mysql-server-4.1_4.1.15-1ubuntu5_i386.deb (--unpack):
subprocess pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-4.1_4.1.15-1ubuntu5_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:

ให้ทำงี้

Ahah, I figured it out. If you delete or move /var/lib/mysql, you can downgrade to 4.1. In other words, it won't downgrade since you have databases that were in mysql 5 format, and by removing the databases you can downgrade.

พูดง่ายๆ ต้อง sudo rm -rf /var/lib/mysql เพราะว่ามันมี database รูปแบบของ version 5 แต่เราจะ downgrade เป็น version 4 ซึ่งตัว setup ก็ downgrade ตัว database ไม่เป็น

ทางแก้ก็คือ ต้องลบทิ้ง - -"

3 comments:

  1. Thank you very much. I was banging my head on my desk trying to figure out why the downgrade was failing, even after I uninstalled and purged all the mysql packages.

    A quick "rm -r" and all was well.

    Thanks again!

    ReplyDelete
  2. thanks worked for me too ;)

    ReplyDelete
  3. Thanks a lot!

    This did wonders :)

    ReplyDelete