Skip to main content

OpenSolaris 2008.05: Installing MySQL 5

Posted by bleonard on June 23, 2008 at 12:25 PM PDT

Looking at the MySQL web site, the instructions for Installing MySQL Community Server seem more complicated then they need to be. Maybe that's because there are no instructions for OpenSolaris (yet - I hope). Here are the easy steps that got me up and running.

Install MySQL

  • Open the Package Manager: System > Administration > Package Manager (give it a couple of seconds to load the package information):

  • Enter mysql5 in the Search text box .The list will filter as you type.

  • Select the check box for SUNWmysql5 and click the Install/Update button in the toolbar;

  • Wait while package dependencies are checked and then click Next on the Install / Update Confirmation dialog:

  • Wait while the packages are downloaded and installed:

  • After which, the Package Manager will show MySQL as installed:

Start the MySQL Service

  • Open System > Administration > Services and scroll down to MySQL RDBMS in the list:

  • Click the check box to enable the MySQL RDBMS:

Verify the Installation

Note, the MySQL documentation's Installation Layouts page does not cover OpenSolaris, but you'll find the binaries in /usr/mysql/bin and the databases in /var/mysql/data.

  • Open a terminal and start the MySQL client:

    bleonard@opensolaris:~$ /usr/mysql/bin/mysql -u root
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 4
    Server version: 5.0.45 Source distribution

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> show databases;
    | Database |
    | information_schema |
    | mysql |
    | test |
    3 rows in set (0.00 sec)

  • If you have NetBeans 6.1 installed it will also show you your MySQL databases in the services tab:

Related Topics >>


Hi Brian, It looks like it is working now. However, I don't quite understand how to add table to one of the databases; for example, on test. I have to create some kind of jdbc connection to mysql with root as user, then I could add a table here. Where does the table go after I create them? Please advice. Regards, Sam

Hi Sam, NetBeans 6.5 should automatically detect MySQL once it's installed and running? Is this not working for you? /Brian

Hi Brian, Could you please advice on how to setup MySQL using NetBeans 6.5? Or could you please direct me to a link? Regards, Sam

Brian, With OpenSolaris 2008.05 you gotta restart the Virtual Image after installing MySQL - only then does it show up in the list of Services. Maybe you should add this step to your instructions. Hemant hemant at sun dot com

I did a restart of the workstation this morning and the service settings did list the MySQL RDBMS... Thanks Brian!

Yup, I blogged about the Sun Web Stack here: And thanks for the tip on importing the SMF manifest. /Brian

A slightly different way to install MySQL, would be to install the webstack and the webstack gui $ pfexec pkg install amp westackui or if you are a developer and want developer tools with your amp stack pfexec pkg install amp-dev webstackui The cool thing with this is the nice GUI that you get in the "Application" -> Developer Tools" Fisrt you get a nice tool initialize the stack, and wen that is do there is set of admin tools for the Webstack, nice :) And to Hermant's comment on the restart, the issue is that the SMF manifest hasn't been imported to SMF, yiou can do as follows: $ pfexec svccfg import /var/svc/manifest/application/database/mysql.xml to verify it's OK $ svcs -xv mysql Cheers, Peter

Interesting. I should have mentioned this in the entry, but you can also start the service from the command line using the following: svcadm enable mysql Does that work for you?

There is no mysql from the service settings list after installing mysql5 using the package manager. I followed the way how you did it.