Page 1 of 1

[HOWTO] install mysql/phpmyadmin

Posted: 27 Feb 2013 17:35
by netnerd
9.1.0.1 - Sandstorm (revision 636)
Build date Tue Feb 5 01:22:23 CET 2013
Platform OS FreeBSD 9.1-RELEASE (reldate 901000)
Platform x64-full on Intel(R) Pentium(R) CPU G630 @ 2.70GHz
Full Install no swap on 32GB USB Drive

Combined information from these two posts:
Nas4Free (Freenas 7.x), install Mysql -- Install MySQL 5.5 https://sites.google.com/site/aganimkar ... extensions
Installing MySQL And phpMyAdmin On FreeNAS -- Installation of PHP/phpMyAdmin http://www.howtoforge.com/installing-my ... on-freenas

:!: connect with ssh and # su to root.
:arrow: Set Package site.

Code: Select all

  
# setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/
:idea: MYSQL: Before install mysq server need add group mysql GID=88 and user mysql UID=88 over webgui
:arrow: Create dir and install package

Code: Select all

# mkdir -p /mnt/data/db/mysql
# chmod -R 777 /mnt/data/db
# ln -s /mnt/data/db/mysql /var/db/mysql
# ln -s /mnt/data/db/mysql /usr/local/data
# pkg_add -r mysql55-server
# rehash
:arrow: Go to dir install db tables

Code: Select all

 
# cd /usr/local
# mysql_install_db
# chown -R mysql:mysql /mnt/data/db/mysql/
# mysqld_safe & 
   add through webgui System|Advanced|rc.conf  mysql_enable="YES"'   
# shutdown -r now
:!: After reboot and test process in top :!:

Code: Select all

 
#  /usr/local/bin/mysqladmin -u root -h localhost password 'NEW-PASSWORD'
#  /usr/local/bin/mysqladmin -u root -h nas4free.local password 'NEW-PASSWORD' 
PHPMYADMIN

Although FreeNAS includes php for its own web interface working upon it, it's good to install extra supporting packages to run php-based applications.
Let's start the process with the following commands:

Code: Select all

 
#  setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/
#  pkg_add  -v -r php5
#  pkg_add  -v -r php5-extensions
#  pkg_add  -v -r php5-xmlrpc
#  pkg_add  -v -r php5-gettext
#  pkg_add  -v -r php5-mcrypt
#  pkg_add  -v -r php5-mysql
#  pkg_add  -v -r php5-mysqli
#  pkg_add  -v -r php5-mbstring
:!: :!: These commands install php5 and some basic packages needed to run phpMyAdmin, after the installation you will not be able to access NAS4free webGUI interface
because of a problem, don't panic let's correct it by issuing the following commands: :!: :!:

Code: Select all

# mv /usr/local/bin/php /usr/local/bin/php-cli
# cp /usr/local/bin/php-cgi /usr/local/bin/php
 
:mrgreen: Back in business! At this point our installation of the MySQL server and PHP has successfully been completed. :mrgreen:



:idea: Installation of phpMyAdmin
:arrow: Let's create a proper directory to hold applications, you are welcome to use you own scheme:

Code: Select all

 
# mkdir -p /mnt/dynamic/apps
# cd /mnt/dynamic/apps
:arrow: Download phpMyAdmin Untar the archeive and create the necessary symbolic links:

Code: Select all

 
# fetch http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.7/phpMyAdmin-3.5.7-all-languages.tar.gz
# tar -zxvf phpMyAdmin-3.5.7-all-languages.tar.gz
# ln -s /mnt/dynamic/apps/phpMyAdmin-3.5.7-all-languages/ /mnt/dynamic/apps/phpMyAdmin
:arrow: Now create a link to run phpMyAdmin from the default location:

Code: Select all

# ln -s /mnt/dynamic/apps/phpMyAdmin/ /usr/local/www/phpMyAdmin
:mrgreen: You can access phpMyAdmin from http://< nas4free ip >/phpMyAdmin/. :mrgreen:

Re: [HOWTO] install mysql/phpmyadmin

Posted: 08 Mar 2013 15:54
by matsojr22
Hey, I'm having some trouble and was wondering if you could offer any advice...

I am returning the error

Code: Select all

freenas:~# setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/
freenas:~# pkg_add -r mysql55-server
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/mysql55-server.tbz: No address record
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/mysql55-server.tbz' by URL
I have scoured the internet for solutions and nothing is working. I have tried setting the PACKAGESITE to loads of different ports... I get the same error every time.
I am using 9.1.0.1 - Sandstorm (revision 636) and putty to ssh in as root.

should I be doing this differently?
I am a long time user of debian, but freeBSD makes no sense to me...

Thanks for any help you can throw my way!

Re: [HOWTO] install mysql/phpmyadmin

Posted: 14 Mar 2013 23:40
by netnerd
That should work? is your network configured ? try to ping yahoo.com do u get a response.

Re: [HOWTO] install mysql/phpmyadmin

Posted: 08 Apr 2013 11:17
by flbatl
# /usr/local/bin/mysqladmin -u root -h localhost password 'NEW-PASSWORD'
# /usr/local/bin/mysqladmin -u root -h nas4free.local password 'NEW-PASSWORD'

I tried running these two commands above but I get the error: /usr/local/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'. How do I fix this?

Re: [HOWTO] install mysql/phpmyadmin

Posted: 08 Apr 2013 11:40
by raulfg3
Revise what is your localhost, can be nas4free.local in a default install, but perhaps you change it on WebGUI.

To avoid fail, you can use nas4Free IP instead localhost

Re: [HOWTO] install mysql/phpmyadmin

Posted: 08 Apr 2013 13:07
by alexey123
I tried running these two commands above but I get the error: /usr/local/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'. How do I fix this?
This simps about mysqld not runnig.
Check your .err file

Re: [HOWTO] install mysql/phpmyadmin

Posted: 08 Apr 2013 13:13
by alexey123
netnerd

Code: Select all

echo 'mysql_enable="YES"' >> /etc/rc.conf
This is wrong way, users need add variable over webgui

Re: [HOWTO] install mysql/phpmyadmin

Posted: 08 Apr 2013 13:50
by raulfg3
alexey123 wrote:netnerd

Code: Select all

echo 'mysql_enable="YES"' >> /etc/rc.conf
This is wrong way, users need add variable over webgui
You are right,

Code: Select all

echo 'mysql_enable="YES"' >> /etc/rc.conf 
only works into a jail, but in pure Nas4Free you need to use WebGUI to avoid code lost on reboot.

Re: [HOWTO] install mysql/phpmyadmin

Posted: 15 Jun 2013 14:13
by lindsay
Why do i get /usr/local/bin/mysqladmin: Exec format error. Binary file not executable.?
Cant set or change password for MySQL

Re: [HOWTO] install mysql/phpmyadmin

Posted: 09 May 2014 18:02
by omegaj
Hello!
I upgraded my NAS and shows error when I access phpMyAdmin, reports that the mysqli is not installed, can anyone help?

"The mysqli extension is missing. Please check your PHP configuration"

When I try to install from the command pkg_add -v -r php5-mysql states that already have an installed version.

Re: [HOWTO] install mysql/phpmyadmin

Posted: 09 Oct 2014 11:23
by pioggiadestate
raulfg3 wrote:
alexey123 wrote:netnerd

Code: Select all

echo 'mysql_enable="YES"' >> /etc/rc.conf
This is wrong way, users need add variable over webgui
You are right,

Code: Select all

echo 'mysql_enable="YES"' >> /etc/rc.conf 
only works into a jail, but in pure Nas4Free you need to use WebGUI to avoid code lost on reboot.
So what's the sequnce to do that?
TNX

Re: [HOWTO] install mysql/phpmyadmin

Posted: 11 Oct 2014 22:09
by Snunn1
pioggiadestate wrote:
raulfg3 wrote:
alexey123 wrote:netnerd

Code: Select all

echo 'mysql_enable="YES"' >> /etc/rc.conf
This is wrong way, users need add variable over webgui
You are right,

Code: Select all

echo 'mysql_enable="YES"' >> /etc/rc.conf 
only works into a jail, but in pure Nas4Free you need to use WebGUI to avoid code lost on reboot.
So what's the sequnce to do that?
TNX
This should answer your question: NAS4Free Wiki - System Advanced rc.conf

Hope this Helps

Re: [HOWTO] install mysql/phpmyadmin

Posted: 17 Dec 2014 16:18
by vinceducat
Hello i follow this tuto all is good except connecting through phpMyadmin

i have this

phpMyAdmin - Erreur

Il manque l'extension mysqli|mysql. Veuillez vérifier votre configuration PHP. Voyez notre documentation pour plus de détails.

sorry it s in french

is this a probleme in remote right acces to mysql server throught phpmyadmin ?

Re: [HOWTO] install mysql/phpmyadmin

Posted: 17 Dec 2014 16:26
by laster13

Re: [HOWTO] install mysql/phpmyadmin

Posted: 17 Dec 2014 16:55
by vinceducat
j ai bien suivi ton tuto merci, il a fallu que je rajoute bind-adress = 0.0.0.0 au fichier my.conf .....

pourrais tu me communiquer un exemple de my.conf car la bien est vide ....

Re: [HOWTO] install mysql/phpmyadmin

Posted: 17 Dec 2014 18:47
by laster13
Bonsoir,

Je suis en embedded, du coup je n'ai pas installé cette version mais celle dans une jail. Par contre je l'ai testé à plusieurs reprise et je n'ai pas eu le soucis que tu rencontré avec ce fichier!

Je te conseille de poster sur le forum francais car Zieg l'a installé très recemment et il pourra t aiguiller!

Re: [HOWTO] install mysql/phpmyadmin

Posted: 02 Jan 2015 16:02
by vinceducat
apres la derniere mise a jour toujours le meme probleme et malgre l ajour de bind-adress = 0.0.0.0 au fichier my.conf impossible de me connecter phpmyadmin