SeeDrs

mysql 5.1.56 Plugin for unRAID 5b11+

Recommended Posts

mysql 5.1.56 Plugin

 

Includes screen, which is used when starting the service from the web gui to stop it form hanging.

 

Download available on unRAID 5 Plugins Page. http://lime-technology.com/wiki/index.php?title=UnRAID_Plugins

 

Copy to /boot/config/plugins and reboot or run "installplg /boot/config/plugins/mysql-5.1.66-i468-4atv.plg"

 

Icon located under the settings tab in network services

 

Updates:

 

Oct 7, 2011 - Fixes permissions issues during install. root password is hard coded to root for the initial install.

 

Oct 10, 2011 - Rewrite bash apply script into php. This eliminated the requirements for screen when starting the mysql service. Also implimented some loggong.

 

Oct 27, 2011 - If my.cf exist in /boot/config/plugins/mysql, it will be copied to /etc and used instead of using /etc/my-medium.cnf

 

Oct 29, 2011 - Corrected typo. my.cf should be my.cnf for custom config

 

SeeDrs

Share this post


Link to post
Share on other sites

mysql 5.1.56 Plugin

 

Includes screen, which is used when starting the service from the web gui to stop it form hanging.

 

Remove the .txt extension, copy to /boot/config/plugins and reboot or run "installplg /boot/config/plugins/mysql-5.1.66-i468-1a.plg"

 

Icon located under the settings tab in network services

 

 

SeeDrs

 

Just a note and something I would like to see...

 

Make screen its own .plg

 

Something like screen can be used by many different reasons so making it its own package makes sense.  I have started taking this approach with my unMenu packages and while it makes for for .conf files it is a much better approach.

Share this post


Link to post
Share on other sites

Reason why I keep it in the package is to ensure that screen is installed before running or starting the plugin.  I think that plug-ins install in alphabetical order, so that means mysql would install before screen causing potential issues.

 

I do have a screen plugin that I made before making the mysql plug-in. I'll post that right now for users who want screen only.

 

A solution to that problem could be solved by having a central repository to store plug-ins, that way if a plugin is dependent on another one it could download it from the repository if it does exist then install it.  This would ensure that dependent plug-ins are install first.

Share this post


Link to post
Share on other sites

SeeDrs,

 

Thank you for this plugin.  This is the very first one I'm trying to use :)... 

 

I installed the plugin using "installplg" since I wanted to avoid a restart.  However, after supplying the data directory (/mnt/cache/_mysql) and a password and then turning it on, I attempted to connect to mysql using (I'm trying to follow the instructions to centralize my xmbc library).

 

mysql -u root -p

 

Unfortunately, I'm getting a can't connect error:

 

Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

 

Any ideas?  I'm running 5.0b12a and connecting via Terminal in Mac OS X Lion.

 

Thanks!

Share this post


Link to post
Share on other sites

SeeDrs,

 

Thank you for this plugin.  This is the very first one I'm trying to use :)...  

 

I installed the plugin using "installplg" since I wanted to avoid a restart.  However, after supplying the data directory (/mnt/cache/_mysql) and a password and then turning it on, I attempted to connect to mysql using (I'm trying to follow the instructions to centralize my xmbc library).

 

mysql -u root -p

 

Unfortunately, I'm getting a can't connect error:

 

Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

 

Any ideas?  I'm running 5.0b12a and connecting via Terminal in Mac OS X Lion.

 

Thanks!

 

 

Under the settings screen for mysql does it say it is running?  I've attached a screenshot of mine. If it doesn't say it is running ensure that Enable mysql is set to Yes and click apply. If it is still not running after that, post the contest of the [yoruservername].err file located in the mysql data directory you specified.

 

Untitled.png.502418eea94e8eb6b82221db56f4b64e.png

Share this post


Link to post
Share on other sites

It did not say that it's running so here's the contents of the *.err file...

 

111007 11:57:15 mysqld_safe Starting mysqld daemon with databases from /mnt/cache/_mysql
111007 11:57:15 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
111007 11:57:15 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
/usr/libexec/mysqld: Can't create/write to file '/tmp/ibT942Ci' (Errcode: 13)
111007 11:57:15  InnoDB: Error: unable to create temporary file; errno: 13
111007 11:57:15 [ERROR] Plugin 'InnoDB' init function returned error.
111007 11:57:15 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
111007 11:57:15 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
111007 11:57:15 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended

Share this post


Link to post
Share on other sites

It did not say that it's running so here's the contents of the *.err file...

 

111007 11:57:15 mysqld_safe Starting mysqld daemon with databases from /mnt/cache/_mysql
111007 11:57:15 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
111007 11:57:15 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
/usr/libexec/mysqld: Can't create/write to file '/tmp/ibT942Ci' (Errcode: 13)
111007 11:57:15  InnoDB: Error: unable to create temporary file; errno: 13
111007 11:57:15 [ERROR] Plugin 'InnoDB' init function returned error.
111007 11:57:15 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
111007 11:57:15 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
111007 11:57:15 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended

 

I'm pretty sure I fugued out the problem. I uploaded a updated version in the OP.  first step is to delete the /mnt/cache/_mysql directory that has been partially created by the previous install before installing the new version.

Share this post


Link to post
Share on other sites

Thanks so much for the quick help, btw.  

 

I installplg'd the new version and things appeared to work.  I got the "mysql is running notice" and no longer get the "can't connect" error message.

 

However, when I now try to connect using mysql -u root -p, I get the following error after entering my password:

 

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

 

(Updated to attach the *.err file, renamed *.txt)

AJs_Unraid.txt

Share this post


Link to post
Share on other sites

And I should note that although I did change my password from what was supplied as default, it is (at least initially) a very simple password, all letters + 1 number...

 

using the new password and the original/default password returns the same error for me...

Share this post


Link to post
Share on other sites

And I should note that although I did change my password from what was supplied as default, it is (at least initially) a very simple password, all letters + 1 number...

 

using the new password and the original/default password returns the same error for me...

 

follow these steps to reinstall mysql with a new root password. This will not save any current data in the database.

 

1. goto mysql settings screen, set enable service to no, click apply. Now it should say mysql is not running.

2. delete the _mysql folder in /mnt/cache

3. go back to the my sql settings screen set enable service to yes. click apply.

 

Now try to logon using the initial root password that you have set in the settings screen.  Once that password is set during the initial install, it can only be change by connecting to the mysql server and doing it there.

 

 

 

Share this post


Link to post
Share on other sites

SeeDrs,

 

Sent you a PM...

 

thanks!

 

I removed the ability to define a root password for the initial install and hard coded it to "root" (without quotes).

 

Try these steps. This will reset all configuration settings

 

1. goto mysql settings screen, set enable service to no, click apply. Now it should say mysql is not running.

2. delete the following folders

   /mnt/cache/_mysql

  /boot/config/plugins/mysql

3. Ensure that you have the latest version from the original post, at this time it is mysql-5.1.66-i468-3atv.plg and that no other version are in the plugin directory.

4. run installplg /boot/config/plugins/mysql-5.1.66-i468-3atv.plg

5. go back to the my sql settings screen, set your datadi path, enable the plugin and click apply.

 

 

 

ssh/telnet to your unraid server and try running mysql -u root -p

 

enter root as the password when prompted.

 

 

 

 

Share this post


Link to post
Share on other sites

Unfortunately,

 

That did not work :(.  I'm still getting the access denied error, even with using "root" as password.

 

 

Share this post


Link to post
Share on other sites

Unfortunately,

 

That did not work :(.  I'm still getting the access denied error, even with using "root" as password.

 

 

 

check your PM

Share this post


Link to post
Share on other sites

Phew!

 

After a long support session, SeeDrs was able to track down my installation issue.  Yay!  It appears that another install of one of my packages modified the permissions of the /tmp directory.  Modifying those permissions via:

 

chmod a+rw /tmp

 

addressed this issue.

 

Starting up unRAID with no packages installed (via unmenu and independently via the go script) confirmed that the permissions are correct in a default install, so it must have been modified by another 3rd party lib/package.

 

Thanks so much SeeDrs!

 

-alex

Share this post


Link to post
Share on other sites

Phew!

 

After a long support session, SeeDrs was able to track down my installation issue.  Yay!  It appears that another install of one of my packages modified the permissions of the /tmp directory.  Modifying those permissions via:

 

chmod a+rw /tmp

 

addressed this issue.

 

Starting up unRAID with no packages installed (via unmenu and independently via the go script) confirmed that the permissions are correct in a default install, so it must have been modified by another 3rd party lib/package.

 

Thanks so much SeeDrs!

 

-alex

That is a very serious issue... whoever/whatever is changing the permissions on the /tmp directory is making a huge mistake. It must exist and be writable, so many programs and utilities expect it to be there and will fail in all kinds of weird ways if it does not exist or is not writable.

 

I hope you track it down and report it to whoever wrote that add-on.

 

Joe L.

Share this post


Link to post
Share on other sites

I think I've tracked down the package that changes the permissions of the /tmp directory.  I will send a message to the compiler of the package.

Share this post


Link to post
Share on other sites

Great work SeeDrs!

 

I just have one question. How can I modify the my.cnf config file without the changes being overwritten on reboot? Should I just edit the /etc/my-medium.cnf file in the archive?

 

Hmm, would a checksum mismatch cause any problems?

Share this post


Link to post
Share on other sites

Great work SeeDrs!

 

I just have one question. How can I modify the my.cnf config file without the changes being overwritten on reboot? Should I just edit the /etc/my-medium.cnf file in the archive?

 

Hmm, would a checksum mismatch cause any problems?

 

What I'll do when I get a chance is to support your own custom my.cnf which you would just save to the /boot/config/plugins/mysql directory.  If it exists there it will use that .cf file.

Share this post


Link to post
Share on other sites

What I'll do when I get a chance is to support your own custom my.cnf which you would just save to the /boot/config/plugins/mysql directory.  If it exists there it will use that .cf file.

 

That would be great. Thanks!

 

Will editing the one in the archive work in the meantime?

Share this post


Link to post
Share on other sites

What I'll do when I get a chance is to support your own custom my.cnf which you would just save to the /boot/config/plugins/mysql directory.  If it exists there it will use that .cf file.

 

That would be great. Thanks!

 

Will editing the one in the archive work in the meantime?

 

It will get over written, I think.  You could always stop mysql and start it manually with your own, but it will be overwritten on reboot, or if you stop/start mysql from the gui

Share this post


Link to post
Share on other sites

What I'll do when I get a chance is to support your own custom my.cnf which you would just save to the /boot/config/plugins/mysql directory.  If it exists there it will use that .cf file.

 

That would be great. Thanks!

 

Will editing the one in the archive work in the meantime?

 

It will get over written, I think.  You could always stop mysql and start it manually with your own, but it will be overwritten on reboot, or if you stop/start mysql from the gui

 

Oh well. I'll just make the changes from the console for now. I don't reboot that often. I'm just forgetful.

 

Thanks.

Share this post


Link to post
Share on other sites

What I'll do when I get a chance is to support your own custom my.cnf which you would just save to the /boot/config/plugins/mysql directory.  If it exists there it will use that .cf file.

 

That would be great. Thanks!

 

Will editing the one in the archive work in the meantime?

 

It will get over written, I think.  You could always stop mysql and start it manually with your own, but it will be overwritten on reboot, or if you stop/start mysql from the gui

 

Oh well. I'll just make the changes from the console for now. I don't reboot that often. I'm just forgetful.

 

Thanks.

 

I updated the version, you can download it from the unRAID Plugin's Page in the wiki, see the original post for the link.  Now it will use the my.cf located in /boot/config/plugsins/mysql if it exists, insead of using medium-my.cf.  I didn't get a chance to test it yet, so let me know if it works.

 

SeeDrs

Share this post


Link to post
Share on other sites

 

I updated the version, you can download it from the unRAID Plugin's Page in the wiki, see the original post for the link.  Now it will use the my.cf located in /boot/config/plugsins/mysql if it exists, insead of using medium-my.cf.  I didn't get a chance to test it yet, so let me know if it works.

 

SeeDrs

 

OK, small issue. It's "my.cnf", not "my.cf". So if I put a custom my.cnf file into /boot/config/plugsins/mysql it is copied to /etc/my.cf but mysql still uses the my.cnf file from the package.

Share this post


Link to post
Share on other sites

Copyright © 2005-2017 Lime Technology, Inc. unRAID® is a registered trademark of Lime Technology, Inc.