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 Issues - unRAID XBMC

Featured Replies

Hi all, been through the ringer with getting MySQL on my unRAID box for my XBMC utilization for a good bit and have finally worked through most pains, but have a reoccurring issue I'd love someone to weigh-in on. (Posted more of my saga below the question, since I have yet to post any feedback on specific forum posts in which I utilized along the way.)

 

Every time I shutdown my unRAID server (v. 5.0.5), upon reboot, my MySQL Server no longer works and I have to completely reinstall the Server, re-add tables, etc. I stop my MySQL Server (have it installed through the Control Panel Using the Ikosa plugin) prior to shutdown, though not sure if that makes a/the difference or not. Any ideas on how to reboot unRAID without losing MySQL Server settings?? (My issue appears as an ERROR 2002 in which my mysql.sock file - apparently?!? - is moved to a temp directory. From a Telnet session it essentially looks like: /var/run/mysql.sock --> /tmp/mysql.sock)

 

Background on how I finally got MySQL running on unRAID. My trials and tribulations aren't completely documented, as I had been trying to install on my unRAID server a few months ago, gave up, installed a MySQL Server on a running XP computer, then finally just tried again when I wanted to cut down on an extra machine running in my office. Whether I installed MySQL via unMenu, manually downloading a plugin (plg) and adding it to the appropriate directories, or through the Control Panel plugin, the two errors I kept encountering were: ERROR 2002 and ERROR 1045.

 

The first error, and my most persistent, has been ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). Essentially, after installing MySQL and trying to log in to the Server (mysql -u root -p), no matter what password I'd enter would result in the inability to access the Server and the 2002 error. The issue, for me, is rooted in the fact that, in my /var/run/ directory the mysql.sock file was not being created automatically. While I played around with a lot of ways to solve this - reinstalls, etc - the easiest solution has been to uninstall MySQL from unRAID, Telnet into my unRAID server from my Windows 7 computer (Putty), and use the "mc" (Midnight Commander) command to ensure all remnants of MySQL are completely removed from my unRAID server. From there, I reboot my unRAID server, reinstall MySQL from the Control Panel, "Enable" MySQL and hit "Apply", then, finally, have to press either "Start" or "Restart" (whichever button is at the bottom of the http://tower/Settings/mysql page initially). Without pressing the Re/Start button, I encounter the 2002 error. *Don't necessarily think I need to mc and delete all remnants, but that's just been my preference to move forward.

 

Once my MySQL Server is running, ERROR 1045 was springing up for my after trying to sign in. No matter if I changed the password from the MySQL Settings page or through a Telnet command, I received this error. What it came to, for me, was that upon first log in - until changed "correctly" - the MySQL Server password was BLANK. OY - go figure!! So, when changing it (in my case): mysqladmin -u root -p password 'xbmc' and it asks for current password, I just - initially - leave the field blank and am good to go.

 

Not sure if my petty solutions will help anyone who has encountered 2002 or 1045, but I'm - mostly - running and happy with MySQL on unRAID for XBMC purposes.

 

Hope someone might have a solution to my problem...so I don't have to reinstall MySQL and rescan my libraries each time. I'm sure I'm doing something(s) wrong...

I'm not an expert, but it seems that you are storing your data in temporary location.  Choose a permanent location like your cache drive or a data drive on the array.  Not the ram or initial location and definitely not your flash.

 

I think you also need to enter your settings before you enable mysql.

  • Author

Thanks for the quick note back. Tried to be thorough in documenting, but obviously left off those important details.

 

unRAID v. 5.0.5

Parity: 3TB

Server Drives: 11, 10 ranging from 2-3TB and the 11th was added solely for MySQL (a 2.5" 60 GB drive)

Cache: None

Flash: 4GB

Location of MySQL: On Disk #12 (the 60GB), I shared the drive and also created a user share "mysql"

Data Directory: /mnt/user/mysql

Backup Directory (if relevant): /mnt/user/backups/mysql

 

Some of the mysql files are stored on the flash drive, which I think is unavoidable (plg, etc), however, I have a drive in my array specified to be solely for my MySQL Server.

  • Author

So, just replaced a drive and had hoped that the guidance here (http://www.tech-recipes.com/rx/762/solve-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock/) would prove helpful. Went into my my.cnf (/etc/) and changed the user and server from "/tmp/mysql.sock" to "/var/run/mysql.sock" then replaced the drive and rebooted my unRaid server and....NOTHING!

 

As my new drive rebuilt, went into my my.cnf file and the locations had reverted themselves back to "tmp/mysql.sock". No idea why! Since drive was rebuilding and couldn't go through my previous troubleshooting steps, tried to again amend the location of the .sock file in the my.cnf file and "Restart" my MySQL Server to no avail. Then - as I'm still waiting for rebuild to be done - deleted the my.cnf file, did a "Restart" of the MySQL Server through the plugin page and ... SUCCESS! WTF?

 

Any ideas?

 

There is no new my.cnf file created. I just have my-huge.cnf, my-large.cnf, my-medium.cnf, and my-small.cnf in the directory that had previously also had my.cnf.

  • 2 months later...
  • Author

BUMP.

 

And, hoping...

Make sure the user share mysql doesn't use the cache drive.

  • Author

No cache drive in my box. Anyone else (PLEASE)????

  • 2 months later...
  • Author

Hey all, hoping someone might have something to help me out. Please respond to the thread, PM me, or other. Just had electrical work done, so server had to be shut down and, subsequently, had to do reinstall MySQL and rescan my library again. With winter coming, am not looking forward to power outages and having to reinstall/rescan over and over and over again.........

...get a ups

  • Author

Someone must be able to teach me how to fish (find a solution) instead of just giving me a fish (UPS, not using MySQL, or taking a hammer to my box)...

 

So, just replaced a drive and had hoped that the guidance here (http://www.tech-recipes.com/rx/762/solve-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock/) would prove helpful. Went into my my.cnf (/etc/) and changed the user and server from "/tmp/mysql.sock" to "/var/run/mysql.sock" then replaced the drive and rebooted my unRaid server and....NOTHING!

 

As my new drive rebuilt, went into my my.cnf file and the locations had reverted themselves back to "tmp/mysql.sock". No idea why! Since drive was rebuilding and couldn't go through my previous troubleshooting steps, tried to again amend the location of the .sock file in the my.cnf file and "Restart" my MySQL Server to no avail. Then - as I'm still waiting for rebuild to be done - deleted the my.cnf file, did a "Restart" of the MySQL Server through the plugin page and ... SUCCESS! WTF?

 

Any ideas?

 

There is no new my.cnf file created. I just have my-huge.cnf, my-large.cnf, my-medium.cnf, and my-small.cnf in the directory that had previously also had my.cnf.

 

Store copies of the edited config files on the flash drive. Copy the files to the desired destination using the go file.

I know this isn't the solution you're looking for but I just wanted to share my experience. I had similar issues until I setup a cache drive. I created a static apps folder on the cache drive that doesn't get transferred to the array. I store the data and config for MySQL on the cache drive in that folder. Haven't had an issue since. Someone can correct me if I'm wrong but I believe this is generally good practice as it will prevent your disks in the array from being spun up when the database is being accessed.

 

Good luck  :D

  • Author

Interesting, Brucy - thanks! I had actually set up a 12th disk (13, if parity is included) for my MySQL. Will see if the cache helps and report back. Definitely not what I was looking for, but am tired of this process...

 

Thanks for the note, dgaschk, but think I'm stuck on a different step right now.

  • 1 month later...
  • Author

No luck with the cache drive (unless somehow I have it configured incorrectly). C'mon unRAIDers, help me crack this nut.

I may have missed the info in your original post but I am using a MySQL plugin from here

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

and have no problems using it with XBMC.

 

For the settings my data directory is

/mnt/cache/.apps/MySql

  • 1 month later...
  • Author

Thanks for checking it out, block134. The fix did not work still. However, on reboot of my unRAID server if I delete the \etc\my.cnf and then restart my MySQL server my libraries are intact without having to rescan. I've tested this twice since 11/28. Thoughts? Can post log files/other if anyone is interested in resolving this with me. Otherwise, I'll live with this clunky fix...

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.