running a mysql server on Napp It

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

epicurean

Active Member
Sep 29, 2014
785
80
28
Newbie here.
i just installed a napp it server on my esxi 5.5 hosts. It hosts data files which is shared and working out well.

I want to to install a mysql server, and would like suggestions on a easy to setup/easy to maintain way to do .
much thanks
 

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
If you want to install an AMP stack on OmniOS, you can either use IPS packages example from Mawi/ University Ulm ( OmniOS Package Repository: uulm.mawi ) or use the packages from SmartOS via pkgin ( Index of /packages/SmartOS/2015Q1/x86_64/ ) that is more complete and up to date.

The napp-it AMP installer is a community add-on that installes AMP + some extra tools like Redis or PHPMyadmin from the above SmartOS repo.
 
  • Like
Reactions: T_Minus

epicurean

Active Member
Sep 29, 2014
785
80
28
Thanks Gea.
Sorry to be so newbie, but how exactly do you install these packages?
 

zos

Member
Oct 27, 2013
41
20
8
Sorry to be so newbie, but how exactly do you install these packages?
Enter the following commands as root:

cd ~
wget -O - www.napp-it.org/amp | perl

After the script has finished, update your PATH and initialize your new mysql-db:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
./mysqlsec.sh

The script mysqlsec.sh will guide you through some questions, e. g. to enter a new password for the mysql- db (initial password should be empty).

Finally you can access your new mysql-database using phpmyadmin by entering

http://<my-server-ip>/phpmyadmin (please replace <my-server-ip> with the IP-adress of your server and you new mysql-db-password)
 

epicurean

Active Member
Sep 29, 2014
785
80
28
Dear Zos,
Thanks so much. I have no idea what you wrote, but I followed it to the letter.
However I got this error trying to access mysql

Forbidden
You don't have permission to access /phpmyadmin on this server.

HOw do I input my password?
 

zos

Member
Oct 27, 2013
41
20
8
Dear Zos,
Thanks so much. I have no idea what you wrote, but I followed it to the letter.
However I got this error trying to access mysql

Forbidden
You don't have permission to access /phpmyadmin on this server.

HOw do I input my password?
Hi epicurean,

I just tried an installation (like described above) in a virtual machine and got the same error. The reason is, that during the installation process downloading phpMyAdmin fails because they changed the download location.

If you try to connect to http://<your-server-ip> you should see

It works!
Show phpinfo()

So in general you don't have to reinstall amp but first I have to modify the amp-script and send it to gea to publish it on napp-it // webbased ZFS NAS/SAN appliance for OmniOS, OpenIndiana, Solaris and Linux :Downloads

But to help you now I set up a small script to install only phpMyAdmin. I uploaded it here:
http://www.wp10455695.server-he.de/phpmyadmin

You can try to install it with the following command:
wget -O - http://www.wp10455695.server-he.de/phpmyadmin | perl

This script creates a separate BootEnvironment (you can display BootEnvironments by entering "beadm list"), so if anything goes wrong, you can restore the last state before executing the script.

After executing the script, try again
http://<your-server-ip>/phpmyadmin
 

epicurean

Active Member
Sep 29, 2014
785
80
28
Thanks Zos! Although I can access phpmyadmin now, I dunno the default password.
In the napp it console, it says mysql under maintenance, is that an issue?
 

zos

Member
Oct 27, 2013
41
20
8
Thanks Zos! Although I can access phpmyadmin now, I dunno the default password.
While executing the script "./mysqlsec" you're asked to enter a new password. You need this new password here. Otherwise the password should be empty.

In the napp it console, it says mysql under maintenance, is that an issue?
Please enter the following command:
svcs -l mysql

I assume the output contains a row like "logfile /var/svc/log/pkgsrc-mysql:default.log".

Now enter the command
cat <logfile>
(replace <logfile> with your logfile's location; in the example above it is "/var/svc/log/pkgsrc-mysql:default.log", so the resulting command would be "cat /var/svc/log/pkgsrc-mysql:default.log")

Please post the displayed output here.
 

epicurean

Active Member
Sep 29, 2014
785
80
28
While executing the script "./mysqlsec" you're asked to enter a new password. You need this new password here. Otherwise the password should be empty.



Please enter the following command:
svcs -l mysql

I assume the output contains a row like "logfile /var/svc/log/pkgsrc-mysql:default.log".

Now enter the command
cat <logfile>
(replace <logfile> with your logfile's location; in the example above it is "/var/svc/log/pkgsrc-mysql:default.log", so the resulting command would be "cat /var/svc/log/pkgsrc-mysql:default.log")

Please post the displayed output here.
Hi Zos,
After cmd "svcs -l mysql", I get this output

Monitor-Extension: Command Log interface.pl 894# svcs -l mysql
p1
main, /_lib/interface.pl, line 898
exe: svcs -l mysql
fmri svc:/pkgsrc/mysql:default
name MySQL RDBMS
enabled true
state maintenance
next_state none
state_time Sat Jul 11 04:10:03 2015
logfile /var/svc/log/pkgsrc-mysql:default.log
restarter svc:/system/svc/restarter:default
contract_id
dependency require_all/none svc:/system/filesystem/local (online)
dependency require_all/none svc:/network/loopback (online)
 

epicurean

Active Member
Sep 29, 2014
785
80
28
While executing the script "./mysqlsec" you're asked to enter a new password. You need this new password here. Otherwise the password should be empty.



Please enter the following command:
svcs -l mysql

I assume the output contains a row like "logfile /var/svc/log/pkgsrc-mysql:default.log".

Now enter the command
cat <logfile>
(replace <logfile> with your logfile's location; in the example above it is "/var/svc/log/pkgsrc-mysql:default.log", so the resulting command would be "cat /var/svc/log/pkgsrc-mysql:default.log")

Please post the displayed output here.
cat <logfile> gives this output:

Monitor-Extension: Command Log interface.pl 894# cat /var/svc/log/pkgsrc-mysql:default.log
p1
main, /_lib/interface.pl, line 898
exe: cat /var/svc/log/pkgsrc-mysql:default.log
[ Jul 9 02:17:16 Disabled. ]
[ Jul 9 02:17:16 Rereading configuration. ]
[ Jul 9 02:17:16 Rereading configuration. ]
[ Jul 9 02:17:16 Rereading configuration. ]
[ Jul 9 02:21:54 Enabled. ]
[ Jul 9 02:21:54 Executing start method ("/opt/local/lib/svc/method/mysqld start"). ]
[ Jul 9 02:21:54 Method "start" exited with status 0. ]
2015-07-09 02:21:54 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[ Jul 10 07:40:00 Stopping because service disabled. ]
[ Jul 10 07:40:00 Executing stop method ("/opt/local/lib/svc/method/mysqld stop"). ]
[ Jul 10 07:40:00 Method "stop" exited with status 0. ]
[ Jul 10 07:41:51 Enabled. ]
[ Jul 10 07:41:51 Executing start method ("/opt/local/lib/svc/method/mysqld start"). ]
[ Jul 10 07:41:51 svc.startd could not set context for method: ]
[ Jul 10 07:41:51 chdir: No such file or directory ("/var/mysql") ]
[ Jul 10 07:41:51 Method "start" exited with status 96. ]
[ Jul 11 04:06:58 Leaving maintenance because disable requested. ]
[ Jul 11 04:06:58 Disabled. ]
[ Jul 11 04:07:00 Enabled. ]
[ Jul 11 04:07:00 Executing start method ("/opt/local/lib/svc/method/mysqld start"). ]
[ Jul 11 04:07:00 svc.startd could not set context for method: ]
[ Jul 11 04:07:00 chdir: No such file or directory ("/var/mysql") ]
[ Jul 11 04:07:00 Method "start" exited with status 96. ]
[ Jul 11 04:10:01 Leaving maintenance because disable requested. ]
[ Jul 11 04:10:01 Disabled. ]
[ Jul 11 04:10:03 Enabled. ]
[ Jul 11 04:10:03 Executing start method ("/opt/local/lib/svc/method/mysqld start"). ]
[ Jul 11 04:10:03 svc.startd could not set context for method: ]
[ Jul 11 04:10:03 chdir: No such file or directory ("/var/mysql") ]
[ Jul 11 04:10:03 Method "start" exited with status 96. ]
 

zos

Member
Oct 27, 2013
41
20
8
cat <logfile> gives this output:
(...)
[ Jul 11 04:10:01 Leaving maintenance because disable requested. ]
[ Jul 11 04:10:01 Disabled. ]
[ Jul 11 04:10:03 Enabled. ]
[ Jul 11 04:10:03 Executing start method ("/opt/local/lib/svc/method/mysqld start"). ]
[ Jul 11 04:10:03 svc.startd could not set context for method: ]
[ Jul 11 04:10:03 chdir: No such file or directory ("/var/mysql") ]
[ Jul 11 04:10:03 Method "start" exited with status 96. ]
As you can see, the directory /var/mysql (=default data directory of mysql) is missing:
[ Jul 11 04:10:03 chdir: No such file or directory ("/var/mysql") ]

This doesn't look like a proper installation.

Let's try to find out, where your mysql data directory resides. Please enter:
find / -name "mysql*" -type d

Also let's have a look where to find the mysql-daemon , enter:
find / -name "mysqld" type f

Please post the output of both commands.
 

epicurean

Active Member
Sep 29, 2014
785
80
28
Hi Zos,
The output are as follows

Monitor-Extension: Command Log interface.pl 894# find / -name "mysql*" -type d
p1
main, /_lib/interface.pl, line 898
exe: find / -name "mysql*" -type d
/opt/local/share/doc/mysql
/opt/local/share/mysql
/opt/local/pkg/mysql-server-5.6.23nb1
/opt/local/pkg/mysql-client-5.6.23
/opt/local/pkg.refcount/users/mysql
/opt/local/pkg.refcount/groups/mysql
/opt/local/lib/mysql
/opt/local/include/mysql
/opt/local/include/mysql/mysql
/opt/local/include/php/ext/mysqlnd
/var/log/mysql
/var/mysql.org
/var/mysql.org/mysql
 

epicurean

Active Member
Sep 29, 2014
785
80
28
And the 2nd output is:
Monitor-Extension: Command Log interface.pl 894# find / -name "mysqld" type f
p1
main, /_lib/interface.pl, line 898
exe: find / -name "mysqld" type f
find: bad option type
find: [-E] [-H | -L] path-list predicate-list