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.

I need to upgrade mysql

Discussion in 'General Discussion' started by junglecat, Dec 2, 2006.

  1. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    WHM 10.8.0 cPanel 10.9.0-R79
    CentOS 3.8 i686 - WHM X v3.1.0

    I'm having problems with mysql and my host suggests I upgrade it to 4.1

    I searched the forums here and didn't find easy instructions. In WHM I see this:

    MySQL Version to use (you must run Software/Update Server Software (or /scripts/mysqlup) for this to take affect. You should then run buildapache/easyapache after changing this option. You may also need to run /scripts/perlinstaller --force Bundle::DBD::mysql. Updating from a previous version of MySQL to a later version is not automatically reversable. You should backup your databases if you think you might wish to downgrade in the future.
    5.0 4.1 4
    Use old style (4.0) passwords with mySQL 4.1+ (required if you have problems with php apps authenticating)


    The instructions and notes are confusing and kind of scary too because it looks like I might break something if I don't do this exactly right. Can someone give me step by step idiot instructions to upgrade Mysql either in WHM or in shell?
     
  2. celliott

    celliott Well-Known Member

    Joined:
    Jan 2, 2006
    Messages:
    460
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Hi,

    You can use these instructions I wrote a while back:

    1. Create a backup of your current databases. I did this by backing up the /var/lib/mysql folder into a tar archive. Its advisable to stop MySQL first, to files in use can be read and databases cannot be changed whilst you upgrade.

    Do this using: tar -czf archivename.tar.gz /var/lib/mysql

    2. Go to WHM > Tweak Settings and tick MySQL 4.1. Click ok, wait 30sec and click the link as instructed. When thats completed open /etc/my.cnf with pico/nano and insert old-passwords under the mysqld tag. e.g.:

    [mysqld]
    old-passwords

    Then Save and exit.

    3. Login to SSH and run /scripts/mysqlup

    4. Recompile apache either with Apache Update in WHM or Easyapache, both do practically the same thing.

    When I migrated my servers to 4.1 I also had to update perl which you can do by this:

    wget http://layer2.cpanel.net/perl587installer.tar.gz
    tar zxf perl587installer.tar.gz
    cd perl587installer
    ./install

    If anything goes pearshaped you have a backup you can roll back on later :)

    Chris.
     
    #2 celliott, Dec 2, 2006
    Last edited: Dec 2, 2006
  3. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Well this is annoying. I have everything open and ready to start the upgrade. But how do you stop mysql? The command service mysql stop says bash: service: command not found :confused:
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    /etc.init.d/mysqld stop
    /etc/init.d/chkservd stop
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    You might want to upgrade to MySQL 5.0 instead as MySQL will stop supprting 4.1 at the end of this month.
     
  6. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    That may break a lot of users' scripts. I've had scripts break after major mysql upgrades before. :(
     
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Tue, which is why after a major MySQL upgrade, one should rebuild PHP. If you keep the old mysql extension, enable the new extension(s) and place MySQL in "compatibility" mode (enable old password hashing) it should minimize breakage.
     
  8. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    [edit]
    Editing out the first part of my post, I think I just solved the problem I was asking about
    [/edit]


    But while I'm posting, these are the steps I've typed into a txt document, are they exactly correct (except for the wrong stop mysql command)?



     
    #8 junglecat, Dec 4, 2006
    Last edited: Dec 4, 2006
  9. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    ARGH :mad:


    root@server6 # /etc/init.d/mysqld stop
    bash: /etc/init.d/mysqld: No such file or directory
     
  10. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Do you get anythign with
    Code:
    ps ax | grep mys
    
    ?
     
  11. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16

    root@server6 [/home/cathy]# ps ax | grep mys
    11670 ? S 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/server6.affiliate-sites.net.pid
    11696 ? S 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/server6.affiliate-sites.net.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    11697 ? S 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/server6.affiliate-sites.net.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    11698 ? S 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/server6.affiliate-sites.net.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    11813 ? S 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/server6.affiliate-sites.net.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    24068 pts/0 D 0:00 grep mys
     
  12. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Try

    Code:
    service mysql stop
    
    If your mysql init file is indeed gone then you'll need to kill the processes manually.
     
  13. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16

    service mysql stop says bash: service: command not found

    I also tried mysqld instead of mysql

    I could do killall mysql but that only works for a second. This is getting frustrating. :(

    I wonder if the missing mysql init file is why I'm having problems with mysql in the first place?
     
  14. randomuser

    randomuser Well-Known Member

    Joined:
    Jun 25, 2005
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    The command isn't found because it's not in your $PATH. To see your path, type: echo $PATH

    When you get a "command not found", you'll need to specify the full path to the command. But first you need to find the command of course:

    # whereis service
    service: /sbin/service

    Now you need to know what the mysql service name is:

    # ls -al /etc/rc.d/init.d | grep mysql

    Whatever the name is that returns, do:
    /sbin/service mysql_service_name stop
     
  15. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    This is what I got:

    root@server6 [/home/cathy]# ls -al /etc/rc.d/init.d | grep mysql
    -rwxr-xr-x 1 root root 5575 May 6 2006 mysql*


    I'm not understanding the mysql service name from that. :confused:

    ETA:

    I tried this:

    root@server6 [/home/cathy]# /sbin/service mysql restart
    Killing mysqld with pid 16163
    Wait for mysqld to exit done

    That seems to work so I think I understand now what you were getting at.
     
    #15 junglecat, Dec 4, 2006
    Last edited: Dec 4, 2006
  16. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Ok, I think I got it done without breaking anything.

    This has been a learning experience! Thank you everyone for your help and patience!
     
Loading...

Share This Page