NYCPHP Meetup

NYPHP.org

[nycphp-talk] pre MySQL upgrade sanity check

Hans Zaunere hans at nyphp.org
Wed Jul 16 14:32:42 EDT 2003


As I sit at an IIS training course...

> 1) shut down mysql and httpd
> 
> 2) I have Mysql client and server installed as RedHat RPMs. Remove these
> with rpm --erase ... after backing up data.
> 
> 3) install MySQL according to
> http://www.mysql.com/doc/en/Installing_binary.html including
> post-installation setup
> 
> 4) rebuild PHP with ./configure --prefix=/usr/local
> --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
> [--with-other-stuff etc]

I always install php into /usr/local/php which can be handy if you have 
multiple installs (for instance, I have distinct DSO and CLI compiles) but this 
is of course just a preferance.  I also like to use the php.ini-recommended 
file, so:  cp PHPSRC/php.ini-
recommended /where/you/installed/to/php/lib/php.ini  (or something like that)

> followed by make; make install
> 
> 5) my httpd.conf has been working fine; leave it alone
> 
> 6) restart httpd and mysql
> 
> 7) crack open a beer

Yes, #7 is vital.  Something else you may want to consider:  since it's 
a "considerable" upgrade from MySQL 3.x to 4.x, I'm always most comfortable 
rebuilding the databases/tables in 4.x (especially if they aren't that big).  
This may just be paranoia, but at a minimum you'll get slightly optimized 
tables.  There are a couple ways of doing this; here's one that I liked:

mysqldump -u 'theuser' -p 'thepassword' --quick --allow-keywords -h thehost.com 
db1 table1 | mysql -u 'root' -p 'passwd' --database=db1new

There are of course variations on the theme, from doing multiple DBs, to 
tables, users, etc.

H



More information about the talk mailing list