Web Hosting Talk







View Full Version : Updating MySQL and PHP


Cael
05-14-2001, 06:07 AM
Has anyone face any error with these new updates released recently? I am want to update them on my raq but I am afraid if there is any problem which might take the server down.

And by the way, can someone post the steps I need to do to upgrade MySQL and PHP ? Like removing the old MySQL package, and how to install PHP over my older version PHP4.04 etc...

Thanks in advance. :)

(SH)Saeed
05-14-2001, 08:52 AM
Donovan,

I just recently upgraded MySQL on my RaQ to the latest. You need to first uninstall your current version. Note that this DOES NOT delete your database information, only the program files. Although MAKE SURE that you do a backup of your database before upgrading. After you uninstall it, you go to http://pkg.nl.cobalt.com/ and copy/paste the new URL in your install software field in your control panel.

So to give you step by step:

1. BACKUP your MySQL database
2. su to root
3. do "cd /var/lib/cobalt/uninstallers/"
4. do "./MySQL-3.23.36-1.uninst" (change this to fit your MySQL version)
5. go to the control panel > maintance > install software and paste "http://pkg.nl.cobalt.com/i386/RaQ3-RaQ4-MySQL-3.23.37-1.pkg" in the install box, install it
6. you are done. your MySQL admin password has been changed to "cobalt-mysql".

to change your password you would type "mysqladmin -uroot -pcobalt-mysql password mynewpass"

Hope this helps.

huck
05-14-2001, 08:55 AM
More Info Please...:)

What versions are you running now???? Please post your versions of MySQL, PERL, PHP, and Apache. Many admins here have ugraded their PHP and MySQL and can help you out, but we need more info on your box.

Also, do you use any PHP cache modules (Zend, afterburner) or other server enhancements. Many of these modules may also need to be updated.


PHP in General
For most of the recent updates there are only minor issues for upgrading, but going from PHP3 to PHP4 could break many scripts, especially those with database connectivity.

MySQL
MySQL upgrades can be a little more trickey, though later updates have been easy. You will have to check the documentation for the upgrade path and see if they list any specific issues that may hinder the process. Later versions of MySQL have changed some of the internals that deal with table types, but you should check this out first. If you have a spare box, I would try it out there first. Also, it is always best to compile MySQL yourself if possible. This is not necessary under a lightly loaded machine, but if you want the best performance, compiling MySQL to match you machine is a must. I have seen database apps gain 10-30% speed increases by simple reinstalling MySQL with appropriate compiler options.

My Server
Cobalt Raq 4i
MySQL 3.23.36
PERL 5.6.0
PHP 4.0.3pl1
Apache 1.3.12

(SH)Saeed
05-14-2001, 09:02 AM
huck,

I heard there were some problems with MySQL 3.23.36 and was advised to upgrade to 3.23.37, which I did a few days ago.

Cael
05-14-2001, 10:09 AM
How can I back up the mysql databases? And need I re-add the users for MySQL ?

By the way, I am using RaQ3 , with php4.04, mysql-3.22.*, zend optimizer etc... installed

(SH)Saeed
05-14-2001, 10:50 AM
To backup a (one) database into a file you would do:

mysqldump -uUser -p DatabaseName >./file.txt

Example:

mysqldump -uzolbian -p zoldb01 >./zol_dump.txt


The above examples will take everything in the given database and put then information into the TXT files. To restore from the files you would do:

mysql -uUser -p DatabaseName <./file.txt

Example:

mysql -uzolbian -p zoldb01 <./zol_dump.txt


Now if you look at the zolbian examples you will see that the first one will dump the information inside the database "zoldb01" into a file named "zol_dump.txt" in the directory where you run the command from. The second example takes the information (including tables) from "zol_dump.txt" and puts them in the database "zoldb01".

You will need to do this for every single database you want to backup. Make sure the username/password you use has access to that specific database.

Good luck.

Cael
05-15-2001, 07:12 AM
So I need to back up the database "mysql" as well? to restore the users ?

huck
05-15-2001, 07:42 AM
The mysql table in the mysql database stores all of the access and user information. If you back it up, you can simply restore all of your user info. Because the mysql table contains the access info, you should never grant anybody other than root access to this table. If you did, they could create admin level accounts, thus allowing the user to modify any table in the mysql database.

(SH)Saeed
05-15-2001, 07:52 AM
Originally posted by Donovan
So I need to back up the database "mysql" as well? to restore the users ?

Yes. As huck said, you will need to back that database as well if you would like to keep your users and permissions.