CarlC Computer Tips, Tricks, and Support

MySQL on OpenVMS loses data if MySQL is not properly shutdown or system crashes

I’ve been busy converting from our old set on OpenVMS of OSU webserver, PHP 3 and MySQL V4. The upgrade consisted of Apache, CWCS from HP, PHP 5 and MySQL V5.


While working on MySQL V5, there was no file to properly say “shutdown mysql properly”. I was stopping MySQL using “stop/id=xxxx”. This is akin to stopping a car by running it straight into a brick wall. Yes, it works, but your going to have to fix the car.


When I did stop MySQL this way, I found some things did not stay in the database. This means, they were in memory, but had not been written to disk yet. Well, that’s not good. To fix this, I did find the right way to shutdown the server, this should go into your sys$


$ mysqladmin -u root –password=”yourpasswordhere” shutdown

$ mysqladmin -u root –password=”yourpasswordhere” shutdown


Yes, twice… I know, it takes two of them… don’t know why, but I know it works. But still, what if the system crashes. I know, OpenVMS NEVER crashes, it’s just reliable and thats that… BUT, I can’t control Florida Power and Light, and I promise you, they will fail, and you will get your crash…


I found adding the –flush to the mysql startup file fixes this. While it slows down mysql’s speed, it does give up the reliability that MySQL has a better chance to not corrupt a table due to a delayed write. So, here’s what the file should look like:


$ set process/parse=extend
$ mysqld :== $ mysql051_root:[vms.bin]mysqld
$ define sys$scratch mysql051_root:[mysql_server.tmp]
$ define /noLOG TMPDIR “/mysql051_root/mysql_server/tmp”
$ define /noLOG DECC$EFS_CASE_PRESERVE enable
$ define /noLOG DECC$EFS_CHARSET enable
$ define /noLOG DECC$FILE_SHARING enable
$ define /noLOG DECC$EFS_CASE_SPECIAL disable
$ define /noLOG DECC$FILENAME_UNIX_ONLY enable
$ define /noLOG DECC$FD_LOCKING enable
$ set rms/ext=20000
$ if f$trnlnm(“LIBZ_SHR32”) .eqs. “” then $ define LIBZ_SHR32 –
$ if f$trnlnm(“LIBZ_SHR64”) .eqs. “” then $ define LIBZ_SHR64 –
$! All options except ansi defined using configuration file my.cnf
$ mysqld  –ansi –flush
$ if f$search (“mysql051_root:[mysql_server.tmp]*.*;*”) .nes. “”
$ then
$      delete mysql051_root:[mysql_server.tmp]*.*;*
$ endif


The –flush is all you have to add.

No Trackback/Pingback

Pinging is currently not allowed.

Comments are closed.