Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Member
    Join Date
    Sep 2005
    Posts
    9

    Default Downgrade from MySQL 5

    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]
    Last edited by chirpy; 05-06-2006 at 11:02 AM.

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member
    Join Date
    Jan 2005
    Posts
    159

    Default

    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. #4
    Member
    Join Date
    Jul 2005
    Posts
    38

    Default

    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/...ng-to-4-1.html) than from 4.1 to 4.0(http://dev.mysql.com/doc/refman/4.1/...g-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/...ng-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. #5
    Member
    Join Date
    Jan 2006
    Posts
    6

    Thumbs down 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. #6
    Member celliott's Avatar
    Join Date
    Jan 2006
    Location
    United Kingdom
    Posts
    460

    Default

    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. #7
    Member
    Join Date
    Jan 2006
    Posts
    6

    Default

    im trying this fix now.

    http://forums.cpanel.net/showthread.php?t=51476

    will let u know if it worked

  8. #8
    Member
    Join Date
    Jan 2006
    Posts
    6

    Default

    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. #9
    Registered User
    Join Date
    Apr 2006
    Posts
    1

    Default

    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. #10
    Registered User
    Join Date
    Mar 2007
    Posts
    2

    Default

    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. #11
    Member
    Join Date
    Jan 2004
    Location
    Mar del Plata - Argentina
    Posts
    246

    Default

    These instructions are still ok to make a downgrade to 4.1? Non users databases like horde, cphulk, roundcube, etc, needs backup too?
    Cristian

  12. #12
    Member
    Join Date
    May 2005
    Posts
    7

    Default

    Quote Originally Posted by benito View Post
    These instructions are still ok to make a downgrade to 4.1? Non users databases like horde, cphulk, roundcube, etc, needs backup too?
    you responded to a 2 years old thread.

  13. #13
    Member
    Join Date
    Jan 2004
    Location
    Mar del Plata - Argentina
    Posts
    246

    Default

    Quote Originally Posted by anatolia View Post
    you responded to a 2 years old thread.
    I totally know that. Thats why i ask if the instruction are still valid. The response is yes, i do it and it works.
    Cristian

Similar Threads & Tags
Similar threads

  1. How can downgrade mysql to 4.0
    By azrael in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-07-2007, 07:30 AM
  2. Downgrade MySQL 5.0 to 4.1.x?
    By Sykoi in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 10-06-2006, 03:28 PM
  3. downgrade MySQL
    By pongtorn in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 06-26-2006, 12:01 AM
  4. MySQL Downgrade
    By cerberus2k in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-12-2003, 11:23 AM
  5. I can't downgrade mysql....
    By now4 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-07-2003, 12:30 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube