MySQL plugin?

Status
Not open for further replies.

Noodle

Dabbler
Joined
Oct 26, 2011
Messages
24
Hi Forum,

Is there a MySQL plugin for FreeNAS? I know many people mentioned how to install MySQL manually, but why no MySQL server plugin? Is it because of too hard to build? or just no requirement?

Thanks

Noodle
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
It is sort of a weird software to have on a NAS don't you think?

I don't think the demand is that high to justify the build of a plugin.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Forum,

Is there a MySQL plugin for FreeNAS? I know many people mentioned how to install MySQL manually, but why no MySQL server plugin? Is it because of too hard to build? or just no requirement?

Thanks

Noodle

It wouldn't be too hard to build. I just think you might as well install + configure mysql from the commandline cause there's no gui to configure your mysql options yet. There's so many factors in things like mysql or apache/nginx, I think theyr'e better just configured from their config files, from the command line. If you really want a plugin, there not too hard to build, but it would be alot of work to setup all the config options for the plugin.
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
It is sort of a weird software to have on a NAS don't you think?

I don't think the demand is that high to justify the build of a plugin.

Perhaps, but MySQL is used by XBMC so that the media metadata library can be stored and accessed centrally by all XBMC clients (players). Since you typically use a NAS with XBMC, it becomes somewhat logical to have a MySQL instance running on the NAS. When you think of it like this, it's not so weird - after all, what other device on the network is guaranteed to be up at the same time as any of the other XBMC clients?

Back on topic - I thought MySQL was available as a plugin? I'm just testing 8.3-RC1 so hopefully it is as it's my intention to install MySQL so that it can service my XBMC clients (several of which will be Raspberry Pi's)...
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Perhaps, but MySQL is used by XBMC so that the media metadata library can be stored and accessed centrally by all XBMC clients (players). Since you typically use a NAS with XBMC, it becomes somewhat logical to have a MySQL instance running on the NAS. When you think of it like this, it's not so weird - after all, what other device on the network is guaranteed to be up at the same time as any of the other XBMC clients?

Back on topic - I thought MySQL was available as a plugin? I'm just testing 8.3-RC1 so hopefully it is as it's my intention to install MySQL so that it can service my XBMC clients (several of which will be Raspberry Pi's)...

It's not available as a plugin (a sinlge pbi file that can be installed in the freenas gui). But there is a thread you can find that several people have used to install mysql to do exactly what you want to do.
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Hi Joshua - yes, I've pieced it all together with about three different threads (in particular this one), the plugin wiki page (I'm new to FreeBSD plugins) and the mysql server ports download page, and I now have MySQL up and running on 8.3.0-RC1, all working well! :)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Joshua - yes, I've pieced it all together with about three different threads (in particular this one), the plugin wiki page (I'm new to FreeBSD plugins) and the mysql server ports download page, and I now have MySQL up and running on 8.3.0-RC1, all working well! :)

Glad to hear it
 

Pepo

Dabbler
Joined
Oct 3, 2011
Messages
13
I think that there are a lot of people out there with the same needs as milhouse. I not a plugin, maybe someone can post a walkthrough?
freenas+MySQL= RaspberryPi XBMC Bliss!!
 

Vanyo

Dabbler
Joined
Oct 2, 2011
Messages
45
Here is a walkthrough:

SSH in freenas
jexec 1 csh

>in jail
pkg_add -r mysql55-server

vi /etc/rc.conf
>add line
mysql_enable="YES"

service mysql-server start

>exit and re-enter the jail

mysql_secure_installation

mysql -u root -p

>in mysql

Code:
CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';
GRANT ALL ON *.* TO 'xbmc'; 
(or a more secure way, if you're using the mysql database other purposes as well:)
GRANT ALL ON *.* TO 'xbmc'@'192.168.1.%' IDENTIFIED BY 'xbmc'; (or whatever ip's you use)

quit;

On your RaspberryPi
find or create the advancedsettings.xml (.xbmc/userdata/)
put the data in:
Code:
<advancedsettings>
	<videodatabase>
		<type>mysql</type>
		<host>your.jail.ip.address</host>
		<port>3306</port>
		<user>xbmc</user>
		<pass>xbmc</pass>
	</videodatabase>

	<musicdatabase>
		<type>mysql</type>
		<host>your.jail.ip.address</host>
		<port>3306</port>
		<user>xbmc</user>
		<pass>xbmc</pass>
	</musicdatabase>
</advancedsettings>


More or less, that's all.
Enjoy!
 

Pepo

Dabbler
Joined
Oct 3, 2011
Messages
13
so I tried to do the above but i think i messed up my rc.conf file (can someone post what a default file looks like?). instead of doing it though VI as i dont know the commands is there a way to WinSCP into the jail and edit the files in Notepad++?
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Default /etc/rc.conf *within the jail* is (at least on my my system, which only has MySQL installed):

Code:
sendmail_enable="NONE"
syslogd_flags="-ss"
pbid_enable="YES"


One way of avoiding vi if you're not familiar with it is to append the required line to /etc/rc.conf:
Code:
echo 'mysql_enable="YES"' >>/etc/rc.conf


That's single quotes around mysql_enable="YES".

Alternatively you could edit the file using your favourite Unix-aware Windows text editor, save the file to you share, and copy the file from the share to /etc within the jail (perform the copy outside of the jail).
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
so i tried to add nano to my jail as i know how to use it better but get an erreor:

Plugin# pkg_add -r nano
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/nano.tbz... Done.
pkg_add: warning: package 'nano-2.2.6' requires 'libiconv-1.14', but 'libiconv-1.13.1_1' is installed

The vi basics are really not that hard, it's usually present on every *nix system, and is worth knowing because of that, and that one day it may save your skin when there is no other alternative (speaking as a developer/admin).
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I agree with Milhouse. I hate VI but it's one of those things were you learn or lose out.
 

Pepo

Dabbler
Joined
Oct 3, 2011
Messages
13
so i performed the above steps but it doesnt look like the Pi recognizes the advancedsettings.xml file... not sure what to do . will post in the raspbmc forums to see if they can help as well.
 

Vanyo

Dabbler
Joined
Oct 2, 2011
Messages
45
Check out the logfile in xbmc, maybe just the privileges in mysql are insufficient.
 

tmacka88

Patron
Joined
Jul 5, 2011
Messages
268
I agree, I think there should be a plugin if someone would be kind enough to make one. It would make it a little bit easier to use for the everyday hack that only wants it for such things as XBMC. This is exactly what I want to use it for as well. Im going give it a try anyway cause I want it but still think that FreeNAS and XBMC should work together better (more natively) as they both depend on each other some much in my case (and prob alot of other users).

cheers
 

tmacka88

Patron
Joined
Jul 5, 2011
Messages
268
I just had a epiphany of which I'm sure I'm the first to think of it or do it. Rather than making a plugin or waiting for one just get a raspberry pi and load mysql straight on to it natively. This has already been done. For the sake of 35$ its not a bad idea
 

tmacka88

Patron
Joined
Jul 5, 2011
Messages
268
That was meant to say NOT THE FIRST. But thanks for the sarcastic reminder.
 
Status
Not open for further replies.
Top