MySQL is an open source database that has gained popularity in the web application world and is used in most of the leading/hot PHP (Hypertext Pre Processor) applications. Now that System i is a supported hardware platform for PHP with the availability of Zend Core for i5/OS, we have documented instructions for downloading, installing and running MySQL in the Portable Application Solution Environment (PASE) on the System i. MySQL is not an IBM i5/OS supported environment, use accordingly.
If you are an ISV interested in running your PHP application on System i please contact sandberg@us.ibm.com or jrush@us.ibm.com. We would like to work with you.
This example was created by interpreting the instructions on www.mysql.com for the PASE environment on the System i.
1. Create user profile mysql. It is a disabled id so it can not be used to sign on to the i5 system but it can be used by MySQL.
CRTUSRPRF USRPRF(MYSQL) STATUS(*DISABLED) TEXT('MySQL user id')
2. Go to www.mysql.com and download the AIX 5.1 (POWER 64-bit) version of MySQL 5.0 to the PC. mysql-standard-5.0.21-aix5.2-powerpc-64bit.tar.gz is the name of the file.
3. Use a zip utility to unzip mysql-standard-5.0.21-aix5.2-powerpc-64bit.tar.gz creating mysql-standard-5.0.21-aix5.2-powerpc-64bit.tar
4. Copy the mysql-standard-5.0.21-aix5.2-powerpc-64bit into the IFS. In this example it is copied to \usr\local
5. Logon to the System i using the QSECOFR user id
6. Enter the PASE environment using call qp2term
7. Change the directory to usr/local cd usr/local/
8. Untar mysql-standard-5.0.21-aix5.2-powerpc-64bit.tar tar -xvf mysql-standard-5.0.21-aix5.2-powerpc-64bit.tar
9. Create a symbolic link ln -s mysql-standard-5.0.21-aix5.2-powerpc-64bit mysql
10. Create the MySQL grant tables. Change directories to mysql cd mysql and then run the command scripts/mysql_install_db—user=mysql
11. Once MySQL has been installed follow the Unix Post-Installation Procedures
12. Start & Stop MySQL
- Start the MySQL server: bin/mysqld_safe—user=mysql &
- Stop MySQL server bin/mysqladmin -u root shutdown
13. Other useful commands for verifying the install are:
- bin/mysqladmin version
- bin/mysqladmin variables
- Simple tests to verify that you can retrieve information from the server:
- bin/mysqlshow
- bin/mysqlshow mysql
Other Topics:
USERS and AUTHORITIES
- GLOBAL: GRANT ALL PRIVILEGES ON <strong>.</strong> TO 'wfusr'@'<span>' IDENTIFIED BY 'wfpass' WITH GRANT OPTION;
(refer to MySQL documentation)
- SCHEMA: GRANT ALL PRIVILEGES ON workflow.* TO 'wfusr'@'</span>' IDENTIFIED BY 'wfpass' WITH GRANT OPTION;
(refer to MySQL documentation)
SAMPLES
- Sample CL program to start MySql in QBATCH subsystem
- Sample PHP app to take user input, write to MySQL DB, and display table to user
- Sample PHP app to take user input, write to DB2 for i5, and display table to user
TOOLS and URLs
- www.i5php.net - iSeries MySQL forum
- MySQL Administrator -- Administer MySQL Server
- MySQL Query Browser -- Use this graphical client to work with your MySQL databases and run queries

Comments
MYSQL userid (in my testing) must be in the *SECOFR usrcls.
Currently I have the daemon running and it is allowing the
'bin/mysqlshow test' work and give results. However; bin/mysqlshow mysql' does NOT work, I get an access denied for user.......
anyway here is the program I am using to start the daemon, EVEN THOUGH I THINK I STILL SOME ISSUES. It may help you help everyone.
>>>>>>>>>> Start code that at least gets the daemon going
PGM
DCL VAR(&CMD) TYPE(*CHAR) LEN(33)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(16)
DCL VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00')
CHGVAR VAR(&CMD) VALUE('/usr/local/mysql/bin/mysqld_safe')
CHGVAR VAR(&CMD) VALUE(&CMD *TCAT &NULL)
CALL PGM(QP2SHELL) PARM(&CMD)
ENDPGM
<<<<<<<<<< End Code
>>>>>>>>>> Start code that is shown in examples by zend and others, BUT does NOT work for me
PGM
DCL VAR(&CMD) TYPE(*CHAR) LEN(33)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(16)
DCL VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00')
CHGVAR VAR(&CMD) VALUE('/usr/local/mysql/bin/mysqld_safe')
CHGVAR VAR(&CMD) VALUE(&CMD *TCAT &NULL)
CHGVAR VAR(&PARM1) VALUE(' --user=mysql &')
CHGVAR VAR(&PARM1) VALUE(&PARM1 *TCAT &NULL)
CALL PGM(QP2SHELL) PARM(&CMD &PARM1)
ENDPGM
<<<<<<<<<<< End Code
If any one can help with the bin/mysqlshow mysql problem I'd be Greatfull!
this gives the correct results
\bin>mysqlshow -u root mysql
while this does NOT
\bin>mysqlshow mysql
At this point it almost has to be some auth issue that I don't get...
I am not very good with unix etc. But working on it.
sid
this gives the correct results
\bin>mysqlshow -u root mysql
while this does NOT
\bin>mysqlshow mysql
At this point it almost has to be some auth issue that I don't get...
I am not very good with unix etc. But working on it.
sid
sorry.
sid
I was unable to find the 5.0.21 file for my install of MySQL, but found the 5.0.27 version instead, so this issue might relate to that.
Everything was going fine until step #10. The 'mysql_install_db' process is unable to find 'my_print_defaults' and the help file 'fill_help_tables.sql' in /support-files. For this second file, I found a copy of it instead in the 'share' folder, but I can't locate 'my_print_defaults'.
Any help would be GREATLY appreciated.