The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Downgrade from MySQL 5

Discussion in 'General Discussion' started by starweb, May 5, 2006.

  1. starweb

    starweb Member

    Joined:
    Sep 28, 2005
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I searched but didn't find it so I will ask.

    I upgraded a new server to MySQL 5.0 to test out some php/mysql functions. Now I want to go back to MySQL 4.1x. The problem is there is no option in WHM/tweak settings to select MySQL 4.1 all that is there is 5.0.

    Any suggestions?

    Thanks


    [edit]
    Dam, tht should say 'DownGrade'.
    [/edit]
     
    #1 starweb, May 5, 2006
    Last edited by a moderator: May 6, 2006
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I fixed the title for you ;)

    If you want a quick and dirty way and you don't have any databases, then you could do the following if you're using an rpm based linux:

    rpm -qa | grep -i mysql-

    Then use rpm -e on each match for MySQL v5.

    Then remove /var/lib/mysql:

    rm -Rfv /var/lib/mysql

    Then edit /var/cpanel/cpanel.config and set:

    mysql-version=4.1

    Make sure that the skip file isn't there:

    rm -fv /etc/mysqlupdisable

    Then install MySQL:

    /scripts/mysqlup --force

    Then update the perl module:

    /scripts/perlinstaller --force Bundle::DBD::mysql

    Then recompile apache/php.

    Of course, if you do have MySQL d/b's then you'll have to consult further on whether they can be downgraded and miss out the removal of the mysql dir.

    Once done:

    /scripts/upcp --force
     
  3. dropby23

    dropby23 Well-Known Member

    Joined:
    Jan 16, 2005
    Messages:
    155
    Likes Received:
    0
    Trophy Points:
    16
    if we have any database do we have any chance to convertt from mysql 5.x to 4.x or 4.1 to 4.0
     
  4. ivankovalenko

    ivankovalenko Active Member

    Joined:
    Jul 19, 2005
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Cant say for sure (never tried myself), but according to docs (http://dev.mysql.com/doc/refman/5.0/en/downgrading.html) you an switch back with less problems from 5.0 to 4.1(http://dev.mysql.com/doc/refman/5.0/en/downgrading-to-4-1.html) than from 4.1 to 4.0(http://dev.mysql.com/doc/refman/4.1/en/downgrading-to-4-0.html). That is becouse of added database,tables and columns charset support. But if you feel yourself strong in working with shell scripts you can try this out.
    I mean you cas cycle the list of databases for dumping and then injecting them in cycle in downgraded server. So the whole recipe sounds like that.
    0. stop mysql from accepting requests - we dont need inconsistent or lost data, do we?
    1. Make backup of all databases (put them aside - just to be sure all will be ok)
    2. Make mysqldump of all databases and tables in compat mysql40 mode. (dont forget a key to recreate database).
    3. Pretend you have no databases
    4. Follow Chirpy's directions on downgrading
    5. Follow directions of official documentation ( insert your dump into mysql and so on - http://dev.mysql.com/doc/refman/4.1/en/downgrading-to-4-0.html)
    5.1 Ensure you've inserted mysql database.
    6. Check permissions on dbs folders in /var/lib/mysql - each folder should have owner like first part before underscore.
    8. In case you're using varios charsets in your databases - check them carefully. Were they converted successfully and are they accessible from mysql command prompt and php/perl scripts.

    Looks like thats all.
     
  5. reesev

    reesev Member

    Joined:
    Jan 3, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    help

    i did exactly what you posted and while compilling apache i got these errors.

    make: *** [libphp5.la] Error 1
    make: *** Waiting for unfinished jobs....
    libtool: link: cannot find the library `/usr/lib/mysql/libz.la'
    make: *** [sapi/cli/php] Error 1


    make php-5.1.4...(install).... . . . Done

    make: *** [libphp5.la] Error 1
    /etc/rc.d/init.d/httpd start: httpd could not be started

    configure php-5.1.4...(--prefix=/usr --with-xml --enable-bcmath --enable-calendar --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --enable-magic-quotes --with-mysqli --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib).... . . . . . . . . . . . Done

    make -j 2 php-5.1.4...(clean).... Done

    make -j 2 php-5.1.4....... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Done

    make: *** [sapi/cgi/php] Error 1
    make: *** Waiting for unfinished jobs....
    libtool: link: cannot find the library `/usr/lib/mysql/libz.la'
    make: *** [sapi/cli/php] Error 1


    make php-5.1.4...(install).... . . . Done

    make: *** [sapi/cgi/php] Error 1
     
  6. celliott

    celliott Well-Known Member

    Joined:
    Jan 2, 2006
    Messages:
    460
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    There are known issues with easyapache and php 5.1.4 currently. If you use 4.4.2 you shouldnt have the problem.

    Chris
     
  7. reesev

    reesev Member

    Joined:
    Jan 3, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
  8. reesev

    reesev Member

    Joined:
    Jan 3, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    ok i tried that fix and i got a ton of virtual host errors i then found the fix for it.

    then i recompiled apache and restarted httpd now when u go to one of my sites u see the index listing with only the cgi bin visable :(
     
  9. johnnyk

    johnnyk Registered

    Joined:
    Apr 23, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    amazing!! great thanks to all here!

    I think I total newbie, I own dedicated machine, I've got data in mysql and I managed to downgrade from 5.0.18 to 4.1.21 by these clues here!! jupi! I'm so happy that something I did and didn't broke anything
     
  10. xenoterracide

    xenoterracide Registered

    Joined:
    Mar 13, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I am trying this but am getting error's in the mysqlup --force.

    Code:
    commit: wrote '/usr/lib/perl5/5.8.7/CPAN/Config.pm'
    CPAN: File::HomeDir loaded ok
    Error while requiring CPAN::MyConfig:
    Can't modify constant item in scalar assignment at /root/.cpan/CPAN/MyConfig.pm line 41, near "};"
    Compilation failed in require at /usr/lib/perl5/5.8.7/CPAN/HandleConfig.pm line 390.
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
    Unable to reset root MySQL password. at /scripts/securemysql line 154.
    Install Complete
    it's being deceptive in saying install complete because it won't start.
     
  11. benito

    benito Well-Known Member

    Joined:
    Jan 8, 2004
    Messages:
    296
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Mar del Plata - Argentina
    These instructions are still ok to make a downgrade to 4.1? Non users databases like horde, cphulk, roundcube, etc, needs backup too?
     
  12. anatolia

    anatolia Member

    Joined:
    May 9, 2005
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    you responded to a 2 years old thread.
     
  13. benito

    benito Well-Known Member

    Joined:
    Jan 8, 2004
    Messages:
    296
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Mar del Plata - Argentina
    I totally know that. Thats why i ask if the instruction are still valid. The response is yes, i do it and it works.
     
Loading...

Share This Page