How to Verify MySQL is Installed on your IBM i

This article can help you determine if MySQL has been installed on your IBM i, and whether it has been installed in a standard location that would be recognized by the Zend DBi updater.

Please log on to a 5250 session as QSECOFR or as a *SECOFR class user.  Enter this command:

call qp2term

This should bring you into the PASE shell.  You will see either a ‘#’ or ‘$’ in the upper left. The ‘#’ will be there for QSECOFR, the ‘$’ for any other user.

Please enter this command:

find / -name mysqld

This command will run a while.  It searches the entire IFS.  Unlike the 5250 command line, the PASE shell does not inhibit input while it runs a command.  This is because PASE runs commands in their own process.  The way you will know that the command is completed is that the ‘#’ or ‘$’ will be displayed.  While you are waiting, it will be possible to type in other commands and press enter, but don’t do it.  It just makes it harder to read the output from the find command.  If you get bored waiting, get a cup of coffee or answer some emails.  Really, this command takes a while.  It will output a line now and then, but remember to wait for the ‘#’ or ‘$’.
When the find command does finally complete the search, your output may be similar to this:

> find / -name mysqld
  $

This indicates no files were found, and MySQL is not installed.

There may be one or more errors:

> find / -name mysqld
  find: 0652-019 The status on /QSYS.LIB/QQFENDSVR.PGM is not valid.
  $

Errors referring to QSYS.LIB can be ignored here.

If your output is similar to this:

> find / -name mysqld
  /usr/local/mysql-5.1.59-i5os-power-64bit/bin/mysqld
  $

The mysqld file was found, and you have MySQL installed. This also indicates the version is 5.1.59. If the mysqld file is found in a path with this format, MySQL was probably installed from a Zend distribution, and should be safe to update using the ZendDBi updater. The format is:

/usr/local/mysql-<version>-i5os-power-64bit/bin/mysqld

If your version of MySQL was previously updated by Zend DBi, you might see two versions of the mysqld file, similar to this:

> find / -name mysqld
  /usr/local/mysql-5.1.50-i5os-power-64bit/bin/mysqld
  /usr/local/mysql-5.1.59-i5os-power-64bit/bin/mysqld
  $

You can tell which version is currently in use by checking the symbolic link for /usr/local/mysql:

> ls -l /usr/local/mysql
  lrwxrwxrwx    1 qsecofr  0                58 Mar 19 2012  /usr/local/mysql ->
   mysql-5.1.59-i5os-power-64bit
  $

In this example, the version in use is 5.1.59.

Bookmark the permalink.

Leave a Reply