Friday, May 23, 2003

Upgrading MySQL to 4.1

I'm going to be moving the MySQL server on my machine from 3.x to 4.0 pretty soon, so I'm always on the lookout for notes on this process. It seems a little scary, because a few things depend on this, like PHP and Apache, so I'm not entirely clear on all the ramifications. Luckily, it seems that backing up the database is pretty easy:



$ mysql
mysql> flush tables with read lock
mysql> ^Z
$ cd /var/db
$ cp mysql mysql.today'sdate
$ fg
mysql> unlock tables
mysql> ^D
$


That will create a nice copy of the database files. Here's a nice message on how to upgrade to 4.1 (which isn't production yet, so I'm just going to 4.0):



su
cvsup -g -L2 /usr/share/examples/cvsup/ports-supfile
cd /usr/ports/databases/mysql4.1-server
make install distclean
rehash
mysqld_safe &
mysqladmin -u root password 'this_is_the_password'
mysql -u root --password='this_is_the_password''
mysql>


No comments:

Post a Comment