MariaDB is the new open source drop-in replacement for MySQL that has been adopted by IBM for use on Power Linux and IBM i. ZendDBi is the installer provided by Zend for installation of MariaDB on the IBM i. In this session we'll show how to use ZendDBi to install MariaDB and provide some important tips for post-installation. We'll also demonstrate troubleshooting some common installation issues. While most installations of MariaDB are trouble free, the troubleshooting procedures will give us a chance to understand a bit more about the operation of MariaDB on the IBM i. It'll also give us the opportunity to explore some concepts on IBM i that may not be familiar to some RPG programmers.
I borrowed this title from wirecutter.com, an electronics review site I really like.
This is always a good place to start.
It should also be a lot easier to determine whether MariaDB is installed.
The PDF version of the manual is very nice, with many color screen shots of the installation procedure. But I made my own for this presentation anyway.
Here is the save file, and the text and pdf versions of the manual. Point out the format of the folder in the address box. It is different when copying.
These instructions are copied verbatim from the user manual. We will see a bit at a time, as we follow them.
These instructions are verbatim from the installation instructions included in the download. If you FTP the file before creating it as a Save File, it will be created automatically as a Physical File.
These instructions are copied verbatim from the user manual. Let’s take a look at netstat *cnn. This is a handy thing to know how to do.
Yes, we can already see that FTP is running, but let’s move on with the demo anyway. I want to show you something about netstat.
F13 brings up the sort window. Select Local Port with a one. The local port must be unique to a service.
Use F14 to show port numbers.
And there is FTP port 21. Now we know what we already new about FTP, but we also know how to sort the netstat *cnn display. This is handy if there is a port conflict.
These instructions are copied verbatim from the user manual. I’ll show you how to copy and paste the directory into the command prompt.
Right clicking the directory collapses it into a more DOS friendly format for copy/paste. Copy it.
This is a handy, if somewhat clunky, feature to use copy and paste in the Command Prompt. Click the C:/ icon to access the context menu.
Don’t miss the bin command!
Enter the FTP command, then your name and password when prompted. Don’t forget the “bin” command! You can copy and past the put command in from the instructions.
This is just a quick sanity check to make sure the file is not a physical. Could happen if we misspelled the save file name when creating it, or when doing the PUT from FTP. dspsavf qgpl/zdbisavf10
I like to do the interactive installation. Makes it easier to spot an issue in the install. Also, the submitted install makes for a very short slide show. I also like to set log level to LOG(4 00 *SECLVL) LOGCLPGM(*YES) although, I did see one installation fail because it wrapped the job log, due to settings on the customer machine.
This is just something I like to do, being a Support guy.
I didn’t manage to capture the “X-System” message mentioned in step 2. It does show up in the screen capture in the PDF user manual.
This tells you the basics of what will be installed. Review each item briefly. Read and press enter.
This is the GNU GPL Version 2. This is part of the answer to “Why MariaDB?”
MySQL was running during this install, so it had port 3306 in use. The installer lets us choose another port.
This takes a while. There is a nice progress bar to keep you entertained while you wait.
Getting closer!
And done! Press the “any” key.
Some more basic installation info. The library name is ZMARIADB, and NOT ZENDDBI. Press F3 to not start up the ZENDDBI10 subsystem. We need to fix my.cnf first.
And that’s it. MariaDB is installed. That was easy! But wait, don’t leave yet. There’s more to do.
Here are some things we can do to head off trouble and make your life easier.
I will show you later how to start from the command line. These CHGAUT commands are too long for the command line on most screens. Use QCMD.
These CHGAUT commands are too long for the command line on most screens. Use CALL QCMD. If MariaDB is running, this requires a restart. But we haven’t started MariaDB yet. That’s next.
Point out the shell program SH and the daemon MYSQLD. If the jobs don’t start up, it is time for trouble shooting.
Take a look at the ZENDDBI10 subsystem to verify that MariaDB is started. Notice the daemon is named mysqld. That’s compatibility. Folder names can be anything, and so they use “maria”. But program and command names and such must always be the same as in MySQL, so they use “mysql”. And they interact with the MySQL extensions in PHP.
This is just about the only support issue we see with MySQL installation – “Won’t start”
Free bonus PuTTY demo! Hopefully you remember how to use netstst *cnn to check if port 22 is active. I told you it would come in handy!
PuTTY has an even odder copy/paste interface than the Windows command prompt. (Talking about the –p option)…But there is a space between “-u” and “root”. Go fig…
The session so far. Not getting a lot of feedback here, but that’s OK. If something doesn’t work there is usually an error. So no news is good news.
This is what I could not do in QP2TERM, not knowing the workaround to use - export TERM=xterm
Now you are not at the $ prompt anymore. You have a MariaDB prompt, indicating you are in the MariaDB client terminal.
I still tend to forget the semicolon from time to time…
Point out four entries for user root. Also, we could have used a select clause in the query to only show user ‘root’. Only the first host has a password. These are all the same host, the server itself. ::1 is the ipV6 equivalent of 127.0.0.1 .
It’s always dicey copying out of Powerpoint or Word into plain text, because of the tilted quotes.
Use the exit commend to leave the MariaDB terminal. No semicolon required. These passwords are a hash for “belladonna”
The IP, port, user, password connection is common to TCP/IP services.
This just shows how to use export TERM=xterm as a workaround to make QP2TERM work with the mysql command. Sorry the slide is hard to read. Maybe it’s a good thing we did this in PuTTY.
We probably won’t do it this way in MariaDB.
I wonder how many User Interfaces are designed by people who work in bash all day?
Too bad setting the root password is a prerequisite, because that sure would have been easier in phpMyAdmin.
This is pretty simple.
Another nice UI!
The icon has a sailboat look, and phpMyAdmin is actually spelled out, and if you hover over it, you get the tip. It’s a little hard to see here, but no problem to find IRL.
The download starts, and there is a progress bar.
When the download is complete, the Next button is enabled.
Some light reading for you, no extra charge!
There is something to do on this screen. Also notice the Virtual Host is the default we just set. Display name defaults to app name, but can be changed if you want. Fill in what is needed, then click Next.
Some more light reading for you! GPL Version 2 again.
This is moving right along!
Be very careful on this screen. Take your time, check your work. A typo here can mean starting all over again. Remember we changed MariaDB to use port 3307, so we have to change it here. The screen loads with the default of 3306.
You can still go back at this point.
This takes a while. While it is happening there is a spinning graphic where the check mark is now.
The application is deployed, and there is even a handy link you can click to launch the app.
And now you have phpMyAdmin, and you can manage all of your MariaDB data. It might take a little time to get familiar with all the things you can do here.
Who doesn’t want the MariaDB server to start up at IPL?
The menu options are just doing ADDAJE and RMVAJE to add or remove the entry. Option 21 adds the entry. Option 22 removes the entry.
These are some familiar MySQL troubleshooting tips. Time will tell how well they apply to MariaDB.
Ironically, the controlling job checks for mysql.sock five times over regular intervals to see if it is there. If it is still missing after five tries, then it decides something is wrong and the daemon must not have started. It issues the generic error, then the customer looks in the job queue and sees five errors about mysql.sock. Five messages! Well, that must be important…
I hate talking about this approach, because so many people seem to assume this is how we handle everything in Support. It is the exact opposite of what we normally do.
Remember I said netstat *cnn can be very useful? Anyway, I meant to say that. Here is a good use for it.
What it isn’t is a missing mysql.sock. Because it isn’t supposed to be there.
This is the step we hoped to avoid by checking the common problems first. It isn’t awful, but can be a little tricky for customers not accustomed to using PASE.
This is the last thing to try, and usually doesn’t help much. If we got this far without fixing it, it is probably something pretty obscure. Or a mistake in a prior step.