Install MySQL on Solaris 11.3

Let’s see whats available
=========================

root@solaris11:/# pkg search -r mysql|grep summary|grep Database
pkg.summary set MySQL Database Management System (Base) pkg:/database/mysql-common@5.11-0.175.3.0.0.30.0
pkg.summary set MySQL 5.1 Database Management System pkg:/database/mysql-51@5.1.37-0.175.3.0.0.30.0
pkg.summary set MySQL 5.5 Database Management System pkg:/database/mysql-55@5.5.43-0.175.3.0.0.30.0
pkg.summary set MySQL 5.6 Database Management System pkg:/database/mysql-56@5.6.21-0.175.3.0.0.30.0
root@solaris11:/#

looks like there are 3 versions out there. Lets go for the latest, but first check it

Check it before installing
==================
root@solaris11:/# pkg info -r mysql-56
Name: database/mysql-56
Summary: MySQL 5.6 Database Management System
Category: Development/Databases
State: Not installed
Publisher: solaris
Version: 5.6.25
Build Release: 5.12
Branch: 5.12.0.0.0.90.0
Packaging Date: January 21, 2016 05:42:10 PM
Size: 447.83 MB
FMRI: pkg://solaris/database/mysql-56@5.6.25,5.12-5.12.0.0.0.90.0:20160121T174210Z

Install It:
===========
root@solaris11:/# pkg install mysql-56
Packages to install: 2
Services to change: 2
Create boot environment: No
Create backup boot environment: No

DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 2/2 231/231 90.0/90.0 143k/s

PHASE ITEMS
Installing new actions 269/269
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
Updating package cache 1/1
root@solaris11:/#

Is it there?
============
root@solaris11:/# svcs -a | grep mysql
disabled 12:38:21 svc:/application/database/mysql:version_56
root@solaris11:/#

Enable the MySQL Service
=====================
root@solaris11:/# svcadm enable mysql
root@solaris11:/# svcs -a |grep mysql
online 13:11:28 svc:/application/database/mysql:version_56
root@solaris11:/#

Install the client  (optional)
==================
root@solaris11:/usr/mysql/5.6# pkg install mysql-56/client
Packages to install: 1
Mediators to change: 1
Create boot environment: No
Create backup boot environment: No

DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 1/1 36/36 25.3/25.3 255k/s

PHASE ITEMS
Installing new actions 60/60
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
Updating package cache 1/1
root@solaris11:/usr/mysql/5.6#

Let’s connect to it
===================
root@solaris11:~# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.21 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> Ctrl-C — exit!
Aborted
root@solaris11:~#

Configuring an NTP client in Solaris 11

Create the file:
================
root@solaris11:/etc/inet# cp /etc/inet/ntp.client /etc/inet/ntp.conf

Add the time servers:
===============
root@solaris11:/etc/inet# echo “server 0.pool.ntp.org” >> /etc/inet/ntp.conf
root@solaris11:/etc/inet# echo “server 1.pool.ntp.org” >> /etc/inet/ntp.conf
root@solaris11:/etc/inet# echo “server 2.pool.ntp.org” >> /etc/inet/ntp.conf
root@solaris11:/etc/inet# echo “server 3.pool.ntp.org” >> /etc/inet/ntp.conf

Now we add some additional configuration information
=======================================
root@solaris11:/etc/inet# echo “driftfile /var/ntp/ntp.drift” >> /etc/inet/ntp.conf
root@solaris11:/etc/inet# echo “filegen peerstats file peerstats type day enable” >>/etc/inet/ntp.conf
root@solaris11:/etc/inet# echo “filegen loopstats file loopstats type day enable” >> /etc/inet/ntp.conf
root@solaris11:/etc/inet# echo “statsdir /var/ntp/ntpstats/” >> /etc/inet/ntp.conf

force a time sync:
=============
root@solaris11:/etc/inet# ntpdate 0.pool.ntp.org
13 Mar 09:17:14 ntpdate[4435]: step time server 24.56.178.140 offset 75669.075952 sec

enable ntp via SMF:
===================
root@solaris11:/etc/inet# svcadm enable ntp

Check it:
=========
root@solaris11:/etc/inet# ntpq -p
remote refid st t when poll reach delay offset jitter
+time.devry.net 10.152.2.2 2 u 19 64 1 33.211 2.980 0.000
*199.102.46.74 ( .GPS. 1 u 19 64 1 41.078 2.592 0.000
+clock.xmission. .GPS. 1 u 20 64 1 77.231 -11.637 0.000
utcnist2.colora .ACTS. 1 u 13 64 1 60.653 -1.643 0.000
root@solaris11:/etc/inet#

Setting up CIFS Sharing on Solaris 11.3 (and connecting with windows)

Some facts:
===========
hostname : solaris11
username : john
poolname : rpool/export/archive
mountpnt : /archive
share    : archive
workgroup: compnect

On solaris

Install SMB server package
==========================

root@solaris11:~# pkg install service/file-system/smb
Packages to install:   1
Services to change:   1
Create boot environment:  No
Create backup boot environment: Yes

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                1/1         29/29      0.7/0.7  297k/s

PHASE                                          ITEMS
Installing new actions                         84/84
Updating package state database                 Done
Updating package cache                           0/0
Updating image state                            Done
Creating fast lookup database                   Done
Updating package cache                           1/1
root@solaris11:~#

Create the dataset you want to share:
=====================================

root@solaris11:~# zfs create rpool\export\archive
root@solaris11:~#

Create the name of the share (what the outside world sees):
===========================================================

root@solaris11:~# zfs set share=name=archive,path=/export/archive,prot=smb rpool/export/archive
root@solaris11:~#

turn on sharing in ZFS:
=======================

root@solaris11:~# zfs set sharesmb=on rpool/export/archive
root@solaris11:~#

Set permissions (don’t worry PAM will handle access)
====================================================
root@solaris11:~# chmod 777 /export/archive

Turn on the SMB server:
=======================

root@solaris11:~# svcadm enable -r smb/server
root@solaris11:~#

Check that the share is active:
===============================

root@solaris11:~# smbadm show-shares solaris11
Enter password:
archive
c$                  Default Share
IPC$                Remote IPC
rpool_export_archive
4 shares (total=4, read=4)
root@solaris11:~#

Enable an existing UNIX user for CIFS sharing:
==============================================

root@solaris11:~# smbadm enable-user john
john is enabled.
root@solaris11:~#

Tell PAM:
=========
root@solaris11:~# echo “password required pam_smb_passwd.so.1 nowarn” >> /etc/pam.d/other

NOTE: You have to reset the users password (it can be the same) so that pam_smb_passwd.so.1 picks it up
and adds it to /var/smb/smbpasswd

Now you have to either join the workgroup or domain:
===============================================================

Use the smbadm join -u username domain-name command to join the domain.
Use the smbadm join -w workgroup-name command to join the workgroup.

I’m going to join my home workgroup compnect:
=============================================

root@solaris11:~# smbadm join -w compnect
After joining compnect the smb service will be restarted automatically.
Would you like to continue? [no]: yes
Successfully joined compnect
root@solaris11:~#

On windows 8.1 (aka micocrap, aka never use an even numbered microsoft product):
================================================================
open file explorer
click on network on the left
click on the network tab
click on add devices and printers

cifs1

 

–sigh– windows can’t find it, so try three more times

cifs2
SUCCESS!!!

Moral of the story:
===================
Solaris 11.3 may be complicated but it WORKS!
Windows may be ok for your grandma but it doesn’t always work until you kick it a few times