Delete MySQL for a clean install, or just to get rid of it

Sometimes you may need to get a fresh start with MySQL.  If so, you will want to do a clean install, which is just deleting the existing installation and doing a new installation. Other times, you may just want to remove MySQL.  This article can help you out either way.

Before you start, you may want to verify that MySQL is in fact installed, and determine the version.  The version will affect some of the directory names to be backed up and deleted, so it is a good idea to run through this, even if you are sure it is installed:

How to Verify MySQL is Installed on your IBM i

1. Back up any MySQL data you want to retain. To learn how to back up and restore your data, please review this chapter in the MySQL manual:

Chapter 7 Backup and Recovery

2. Sign on to a 5250 session as QSECOFR.

3. Setting the CCSID to 37 during installation can help prevent some issues. From the 5250 command line:

CHGJOB CCSID(37)

4. Uninstall MySQL

• Stop the ZENDDBI subsystem:

ENDSBS ZENDDBI OPTION(*IMMED)

• Back up your existing MySQL directories. Navigator makes this an easy copy and paste. Create some back up directory. Click the directory you want to back up, and select Copy. Click the back up directory and select paste. The directories to back up are:

/usr/local/mysql-5.1.59-i5os-power-64bit
(this directory name depends on the MySQL version, so may be different)

/usr/local/mysqldata

• Delete the ZMYSQL library:

DLTLIB ZMYSQL

• Enter the PASE shell:

CALL QP2TERM

• Remove the /usr/local/mysql link

rm -f /usr/local/mysql

• Remove the /usr/local/mysql-5.1.59-i5os-power-64bit directory (the directory name depends on the MySQL version, so may be different)

rm -r -f /usr/local/mysql-5.1.59-i5os-power-64bit

(wait for the # or $ to appear, before entering the next PASE command)

• Remove the /usr/local/mysqldata directory

rm -r -f /usr/local/mysqldata

(wait for the # or $ to appear, before entering the next PASE command)

• Remove the /etc/my.cnf file

rm -f /etc/my.cnf

• If the file /tmp/mysql.sock exists, remove it:

rm -f /tmp/mysql.sock

• Exit the PASE shell by using F3.

5. Install MYSQL from the Zend Server setup menu. This article tells how:

http://rodflohr.com/install-mysql-using-the-zenddbi-installer-with-zend-server/

6. Restore your saved MySQL data from step 1.

Bookmark the permalink.

Leave a Reply