Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MySQL Plugin with Backup 0.2.3

Featured Replies

I'm proud to present beta version of mysql plugin with automated and manual backup options. This plugin is based on p1lot's plugin. Most of the credit goes to p1lot and other contributers. I move my plugin to new topic so users can find it easily without reading the all pages and for better maintance.

 

I strictly suggest backup before install.

 

Changes:

- Automated and manual backup options added.

- my.cnf chmod fix,

- plg update feature added,

- start/restart/stop controls added,

- my.conf typo fix,

- filename changed to a static one for easy update,

- page version changed to plugin version for maintance,

- all contributers added to author section.

 

Known Issues:

- output does not fit to the progressFrame because of uncorrect font size.(need help)

 

Download Plugin

 

Installation:

1) make a bakup of your database if exists

2) stop mysql if installed

    a) run "/etc/rc.d/rc.mysql stop" from telnet

    b) press stop from control panel

3) download my plugin (right click save target as) to /boot/config/plugins

4) make sure file name is mysql-ikosa.plg

5) run "installplg /boot/config/plugins/mysql-ikosa.plg" from telnet or restart server

6) fill the plugin parameters from plugin page (http://tower/Settings/mysql)

7) click apply (this should start your myqsl server if you choose "Enable MySQL:" "Yes")

8) check you database

9) you can delete old mysql5_*.plg file or move to somewhere else.

 

Notes:

- For now ssmtp package has to be installed and configured manually (or from unmenu) for the mail function. Later maybe i will add it to the plugin.

- Although i double/triple check everything, dont forget that this is a beta plugin and may have errors. Use it with your own risk.

- Also keep in mind that there is a security issue: Since i dont know a better way to do this plugin stores the mysql server password unencrypted in the cfg file.

 

Keep me posted about your experiance. Any comments are welcome.

  • Replies 53
  • Views 11.8k
  • Created
  • Last Reply

Hi all

I would really like to install MySQL as I am now running xbmc upstairs as well as downstairs and a centralised database sound great.  However can someone point me in how this is setup as there are a lot of threads on this and finding info is not straight forward.

 

I have installed MySQL Plugin with Backup 0.2.2 and attempted to follow the instructions from here

 

http://lime-technology.com/forum/index.php?topic=11473.0

 

but omitting the install from unmenu.  However when I run mysql -u root -p I get the below error

 

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) -bash: syntax error near unexpected token `('

 

 

can someone point me in the right direction.  I am running unraid version 5 with no other plugins

Thanks

Got MySQL running but cant log in

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

 

Any ideas

  • Author

i guess initial root password can be empty try without pass.

i guess initial root password can be empty try without pass.

 

Thanks for reply

I changed password in web gui also tried root and with no password I get

 

root@Tower:~# mysql -u root -

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N                                    O)

 

Also getting this error

Sep 30 15:48:11 Tower useradd[15442]: failed adding user 'mysql', data deleted

  • Author

I also get that error not sure about why but that's not your problem. I have some posts at the original mysql threads end you try that options too...

 

Sent from my HTC Desire using Tapatalk 4

 

  • Author

It will be slower than before but not very very slow. There were some tweaks at the xbmc forum I guess may be they can help a little...

Will you share how you solve your problem for others?

 

Sent from my HTC Desire using Tapatalk 4

 

 

  • Author

here is my my.cnf file i guess tweaks are here.

 

# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password	= your_password
port		= 3306
socket		= /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port		= 3306
socket		= /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
# 
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id	= 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /mnt/user/No_move/mysql
#innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /mnt/user/No_move/mysql
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

It will be slower than before but not very very slow. There were some tweaks at the xbmc forum I guess may be they can help a little...

Will you share how you solve your problem for others?

 

Sent from my HTC Desire using Tapatalk 4

 

Thanks

Xbmc is now starting a lot quicker (back to normal) I forgot to edit second ip addy in advance settings file (only edited for music missed video :-)

 

As far as configuring MySQL in telnet I don't know how it got resolved eventually I hit enter with no password and all was ok although I had done this several times before with no luck but hey it now works

 

Cant seem to get the update library feature now working in XBMC I can map to and add my files etc but wont scrape / update library for some reason

  • Author

Cant seem to get the update library feature now working in XBMC I can map to and add my files etc but wont scrape / update library for some reason

 

i think there is np specific settings for libraray updates. just you need write permission to mysql. but if you can add files this means xbmc can write to mysql. about this issue xbmc forums are a better place to get help. 

  • 2 months later...

These two plugins (MySQL 5.5 Plugin by p1lot and MySQL Plugin with Backup 0.2.2 by ikosa) are not working as expected.

 

I cannot get ikosa's to work - so I am done with that.

 

p1lot's plugin I can get installed and working but I am able to keep the system from changing the mod on the my.cnf.  It will not stay at 644.  It reverts back to world-writable.  I am not able to get the my.cnf file to stay in chmod 644.

 

Has anyone figured out how to copy the my.cnf file from /boot/config/plugins/mysql folder and change permission to 644 prior to the mysql daemon starting?

 

I am about ready to give up and put MySQL on Ubuntu or Windows VM for use with XBMC.

 

I start to modify pilot's plugins because of this issue. Read from this message: http://lime-technology.com/forum/index.php?topic=20603.msg261112#msg261112

 

and if you give more detail about why plugin is not working (preferably in my plugins thread) may be i can help.

 

ikosa, I have copied the quotes from the post http://lime-technology.com/forum/index.php?topic=20603.msg261303#msg261303 and pasted them here.

 

I am seeing the same errors as you mentioned back on Sept 1 here in your thread and other has stated about the my.cnf file.  I would seem that when the plugin copies the my.cnf file from /boot/config/plugins/mysql to /etc the permission are not getting set correctly.  There was mention of running chmod 644 /etc/my.cnf from within the plg package or from the go script, but I do not see the proper way of doing that.  Also I have tried to manually running the chmod command to set the permission and the restart mysql but it appears that all that does is re-copy the file from mysql plugin folder mentioned earlier.

 

So now I have given up trying to get MySQL to work on unRAID and have created a Ubuntu Server VM to handle the MySQL databases for my XBMC library consolidation.  So far the Ubuntu VM is working flawlessly.

 

I may revisit this plugin in the future.  Thank you for all your good work.

  • Author

Hi Again StanC:

 

As I mentioned before, that permission problem is the main reason to modify pilot's plugin. I'm sorry to hear it is not working for you. Below part is the part that fixes the permission. Maybe you can try these steps manually to troubleshoot the error. But you find your path with ubuntu...

 

    if (file_exists("/boot/config/plugins/mysql/my.cnf")) {
      unlink("/etc/my.cnf");
      copy("/boot/config/plugins/mysql/my.cnf", "/etc/my.cnf");
  //fix permissions of my.cnf
  exec_log("chmod 644 /etc/my.cnf");
    }
    else {
      exec_log("cp /etc/mysql/my-medium.cnf /etc/my.cnf");
      exec_log("sed -i -e '/^#innodb_data_home_dir/c\\innodb_data_home_dir = '$DATADIR'' /etc/my.cnf");
      exec_log("sed -i -e '/^#innodb_log_group_home_dir/c\\innodb_log_group_home_dir = '$DATADIR'' /etc/my.cnf");
      exec_log("sed -i -e '/^#innodb_log_arch_dir/c\\innodb_log_arch_dir = '$DATADIR'' /etc/my.cnf");
    }

can't get this to start.

 

the plug in is installed, and I can load up the settings page. but when I hit start it just refreshes and it still saying stopped.

 

screen shot of settings page attached.

sqlerr.jpg.5b2d1bc629606306fa87e17476d4f036.jpg

  • Author

Try apply

  • Author

If not, try "/etc/rc.d/rc.mysql start --user=mysql" this command from command line and see if there is an error

I have a problem i hope you can help me with.

 

I have my Mysql data directory set in the Unraid settings page to /mnt/cache/mysql and when i try to start the plugin it just sits at Stopped.

 

I tried "/etc/rc.d/rc.mysql start --user=mysql" from command line and it gave the following error:

 

"Error! the server quit without updating pid file (/var/run/mysqld/mysqld.pid)"

 

I then thought to change when there Mysql data directory was set to /mnt/user/mysql and then tried to start the plugin - it worked first time.

 

I then tried starting it with "/etc/rc.d/rc.mysql start --user=mysql" and it also worked.

 

I would rather that the mysql data was set to the cache drive, any help appreciated.

 

Thanks

Hi ikosa,

My first unRAID server got updated with a new motherboard, CPU, RAM and cache drive so I decided to try this plugin on the old hardware.

This new server has three small HDD's and runs the latest version 5.0.4 on a brand new flash drive.

First I installed control panel plugin (BTW love it) then mysql using control panel.

After the installation everything looked OK, used Apply and the server started but if you stop the server using the Stop button from the plugin page the server cannot be started from either the plugin page or the control panel plugin by pushing the start button, or by clicking on the Apply button. I also tried to change the path on the plugin page and then hit apply but no result.

The /etc/rc.d/rc.mysql start --user=mysql returned

Starting MySQL. ERROR! The server quit without updating PID file (/var/run/mysql/mysql.pid).

 

The only other thing installed on the machine is unMenu, do I need to install SimplFeatures also like in your setup?

 

 

mysql_plugin_page.png.94cb4edb4ab1bd4f9f438a690ed4c6e4.png

  • Author

Hi soana,

 

will you try and share output of these commands:

ls -l /mnt/user/

ls -l /mnt/user/mysql

 

intalling simplefeatures is up to you it is not needed for control panel or mysql. And they all run with it without problems.

Here is the output:

 

root@Tower2:~# ls -l /mnt/user/
total 0
drwxrwxrwx 1 nobody users  48 2013-12-09 19:54 Storage/
drwxrwxrwx 1 nobody users 400 2013-12-10 17:27 mysql/

 

 

root@Tower2:~# ls -l /mnt/user/mysql
total 21150
drwx------ 1 root root       72 2013-12-09 22:00 Tower/
-rw-rw---- 1 root root     2372 2013-12-10 17:29 Tower2.err
-rw-rw---- 1 root root  5242880 2013-12-10 17:29 ib_logfile0
-rw-rw---- 1 root root  5242880 2013-12-09 22:00 ib_logfile1
-rw-rw---- 1 root root 10485760 2013-12-10 17:29 ibdata1
drwx------ 1 root root     1752 2013-12-09 22:00 mysql/
-rw-rw---- 1 root root    15064 2013-12-09 22:00 mysql-bin.000001
-rw-rw---- 1 root root   628368 2013-12-09 22:00 mysql-bin.000002
-rw-rw---- 1 root root      969 2013-12-09 22:09 mysql-bin.000003
-rw-rw---- 1 root root      386 2013-12-10 17:29 mysql-bin.000004
-rw-rw---- 1 root root       76 2013-12-10 17:27 mysql-bin.index

 

  • Author

As i said before it seems like there is a problem with permissions. Try:

 

chown -R mysql:users /mnt/user/mysql

 

Than try to start mysql again.

Server is still stopped.

 

root@Tower2:~# chown -R mysql:users /mnt/user/mysql
root@Tower2:~# ls -l /mnt/user/mysql
total 21150
drwx------ 1 mysql users       72 2013-12-09 22:00 Tower/
-rw-rw---- 1 mysql users     2372 2013-12-10 17:29 Tower2.err
-rw-rw---- 1 mysql users  5242880 2013-12-10 17:29 ib_logfile0
-rw-rw---- 1 mysql users  5242880 2013-12-09 22:00 ib_logfile1
-rw-rw---- 1 mysql users 10485760 2013-12-10 17:29 ibdata1
drwx------ 1 mysql users     1752 2013-12-09 22:00 mysql/
-rw-rw---- 1 mysql users    15064 2013-12-09 22:00 mysql-bin.000001
-rw-rw---- 1 mysql users   628368 2013-12-09 22:00 mysql-bin.000002
-rw-rw---- 1 mysql users      969 2013-12-09 22:09 mysql-bin.000003
-rw-rw---- 1 mysql users      386 2013-12-10 17:29 mysql-bin.000004
-rw-rw---- 1 mysql users       76 2013-12-10 17:27 mysql-bin.index

 

Tower.err shows this after trying to start the server from GUI:

131211 06:35:12 mysqld started
131211 6:35:12 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
131211 6:35:12 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
131211 6:35:12 [ERROR] /usr/libexec/mysqld: unknown variable 'table_open_cache=64'
131211 06:35:12 mysqld ended

 

Trying to start manually:

root@Tower2:~# /etc/rc.d/rc.mysql start --user=mysql
Starting MySQL. ERROR! The server quit without updating PID file (/var/run/mysql/mysql.pid).

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.