Jump to content
hawihoney

New unMENU package: mySQL

41 posts in this topic Last Reply

Recommended Posts

The unMENU package manager is a fine piece of software. Now even Linux noob's like me can install mySQL on an unRAID server. Here are the required steps:

 

  • Copy and paste the code shown below (in the first border) into a file called 'mysql-unmenu-package.conf'.
  • Modify the text 'your_password' with a password of your own. Don't mix 'your_password' with 'password'. The later is a key text and should not be changed.
  • Modify the text '/mnt/disk1/mysql' with a location on your unRAID server. I tried to put the database on a user-share but this won't work because of the mysql user having no permission to do so.
  • Modify the text 'Tower2' with the hostname of your unRAID server. Issue 'hostname' on your shell to find the name.
  • Put this modified 'mysql-unmenu-package.conf' file on your unRAID USB stick into the directory '/packages'. This directory should exist after successful installation of unMENU and it's additional files.
  • Open unMENU (usually with 'http://Tower:8080/') and click on the 'Package Manager' link.
  • You will see (hopefully) a new package called 'mysql (SQL-based relational database server)'.
  • With the 'download' button right beside the package you can now download (for the first and only time) the package itself. The package is 17MB and the transfer will take some time.
  • After successful installation you can instruct unMENU to re-install the mySQL package after every re-boot. If you don't do so the mySQL installation will no longer exist after the next re-boot. However, the database files will still exist even if you didn't select this option!
  • This unMENU package configuration will automatically create a sample database called 'Helium'. Change that to a database name of your own needs. If you don't want to create a new database simply remove these two lines.

 

I tested this package on a plain unRAID 4.4 installation. My server is from Lime Technology and thus confirms to the unRAID requirements. I tested this package at my very best. Please use it at your own risk.

 

 

PACKAGE_NAME mysql (SQL-based relational database server)
PACKAGE_DESCR MySQL is a fast, multi-threaded, multi-user, and robust SQL
PACKAGE_DESCR (Structured Query Language) database server.  It comes with a nice API
PACKAGE_DESCR which makes it easy to integrate into other applications.
PACKAGE_DESCR The home page for MySQL is http://www.mysql.com/
PACKAGE_URL http://slackware.cs.utah.edu/pub/slackware/slackware-current/slackware/ap/mysql-5.0.67-i486-1.tgz
PACKAGE_FILE mysql-5.0.67-i486-1.tgz
PACKAGE_MD5 2152772395c13f5af16874760105a33d
PACKAGE_INSTALLED /usr/bin/mysql
PACKAGE_DEPENDENCIES none
PACKAGE_INSTALLATION installpkg mysql-5.0.67-i486-1.tgz
PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql ] && mkdir /mnt/disk1/mysql
PACKAGE_INSTALLATION chown -R mysql /mnt/disk1/mysql/
PACKAGE_INSTALLATION cp /etc/my-medium.cnf /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_data_home_dir = \/var\/lib\/mysql\//innodb_data_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_log_group_home_dir = \/var\/lib\/mysql\//innodb_log_group_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_log_arch_dir = \/var\/lib\/mysql\//innodb_log_arch_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/ --user=mysql
PACKAGE_INSTALLATION cd /usr ; /usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql &
PACKAGE_INSTALLATION [ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root password 'your_password'
PACKAGE_INSTALLATION [ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password password 'your_password'
PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql/Helium ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password create Helium
PACKAGE_INSTALLATION [ -d /mnt/disk1/mysql/Helium ] && mysql -u root -h Tower2 --password=your_password --database=Helium -e "GRANT ALL PRIVILEGES ON Helium.* TO root@'%' IDENTIFIED BY 'your_password' WITH GRANT OPTION;"
PACKAGE_INSTALLATION [ -d /mnt/disk1/mysql/test ] && /usr/bin/mysqladmin -u root -h Tower2 -f --password=your_password drop test
PACKAGE_INSTALLATION touch /mnt/disk1/mysql/.unmenu
PACKAGE_VERSION_TEST mysql --version 2>&1 | grep Distrib | awk '{print $5}'
PACKAGE_VERSION_STRING 5.0.67,
PACKAGE_MEMORY_USAGE May be huge

 

The idea behind my installation script is to keep the mySQL code and the global mySQL configuration file called 'my.cnf' in the unRAID environment (in RAM). The database files are stored on one of your disks. The installation, once the first and only download of the package is over, is very fast. There is no reason to not re-install the package after every re-boot.

 

As I'm a Linux noob I would like to explain the steps I do with this conf. A second pair of eyes from a Linux expert is highly welcomed. Here we go:

 

PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql ] && mkdir /mnt/disk1/mysql
--> If the data directory does not exist - create it.

PACKAGE_INSTALLATION chown -R mysql /mnt/disk1/mysql/
--> The owner of the data directory must be the mysql user.

PACKAGE_INSTALLATION cp /etc/my-medium.cnf /etc/my.cnf
--> Copy the mySQL configuration template for mid-sized databases to '/etc'. Name it 'my.cnf'. This will be the global configuration for mySQL.

PACKAGE_INSTALLATION sed -i -e "s/#innodb_data_home_dir = \/var\/lib\/mysql\//innodb_data_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_log_group_home_dir = \/var\/lib\/mysql\//innodb_log_group_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_log_arch_dir = \/var\/lib\/mysql\//innodb_log_arch_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
--> Change the data directory template for mySQL innoDB databases to your data directory. If you will never use innoDB databases you can remove these three lnes.

PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/ --user=mysql
--> If there is no directory for mySQLs system tables let mySQL issue all required steps to initiate the data directory.

PACKAGE_INSTALLATION cd /usr ; /usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql &
--> Start the engine.

PACKAGE_INSTALLATION [ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root password 'your_password'
PACKAGE_INSTALLATION [ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password password 'your_password'
--> If this is the very first installation set some root passwords.

PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql/Helium ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password create Helium
PACKAGE_INSTALLATION [ -d /mnt/disk1/mysql/Helium ] && mysql -u root -h Tower2 --password=your_password --database=Helium -e "GRANT ALL PRIVILEGES ON Helium.* TO root@'%' IDENTIFIED BY 'your_password' WITH GRANT OPTION;"
--> With these two lines you can create your own database. This sample database is called 'Helium'. Change that name or, in case you don't want to create a new database, remove both lines.

PACKAGE_INSTALLATION [ -d /mnt/disk1/mysql/test ] && /usr/bin/mysqladmin -u root -h Tower2 -f --password=your_password drop test
--> mySQL itself creates a 'test' database. The script will drop this database .

PACKAGE_INSTALLATION touch /mnt/disk1/mysql/.unmenu
--> To find out if this is the very first installation the script creates a '.unmenu' file in the data directory.

 

 

Now some drawbacks:

  • A standard unRAID installation comes with no swap space. If your databases become bigger or you don't have RAM enough your system will experience trouble because of missing swap space. I have no idea how to create swap space on an unRAID system (noob alarm!). However, while I'm writing this message one of my databases is filled with some GB of data. Ok, I own 4GB RAM but I know that I have to introduce swap space at a later point. Even if a database is small, a bad written DML may eat up all the RAM you own.

 

 

Any comments?

 

Regards

Harald

 

 

Share this post


Link to post

This post here has a short script that shows how to configure a swap file.

 

It configures it on your flash drive... If you modify it to use a file on a unraid managed disk (disk1, disk2, etc) it will still work, but you will probably need to issue a

swapoff -a

command before you stop the array, otherwise, the swap file might keep the disk from properly being unmounted.

 

If you have a cache drive configured,it is a far better location for the swap file.  Something like this:

SWAPFILE=/mnt/cache/.unraid.swapfile might be a better choice. (Note: the file name has a leading "period" to keep it from being moved from the cache drive by the "mover" script.)

 

Joe L.

Share this post


Link to post

Hi and thanks for the post!

 

First of all, slackware-current is now 12.2, so a direct link won't work  :(

 

Anyway, I tried this little adventure and get the following:

 

sed: -e expression #1, char 69: unterminated `s' command

/boot/packages/mysql-5.0.67-i486-1.tgz.manual_install: line 7: unexpected EOF while looking for matching `"'

/boot/packages/mysql-5.0.67-i486-1.tgz.manual_install: line 16: syntax error: unexpected end of file

 

Any ideas?

 

 

Share this post


Link to post

Hi and thanks for the post!

 

First of all, slackware-current is now 12.2, so a direct link won't work  :(

 

Anyway, I tried this little adventure and get the following:

 

sed: -e expression #1, char 69: unterminated `s' command

/boot/packages/mysql-5.0.67-i486-1.tgz.manual_install: line 7: unexpected EOF while looking for matching `"'

/boot/packages/mysql-5.0.67-i486-1.tgz.manual_install: line 16: syntax error: unexpected end of file

 

Any ideas?

 

 

 

Can you post the contents of YOUR /boot/packages/mysql-5.0.67-i486-1.tgz.manual_install file... maybe there is something to be learned there...

 

My first guess is that the sed command on line 7 is missing a closing '"' for the -e argument.  It may also be a problem with the file location you are specifying.  The file I mentioned should tell us more.

 

Cheers,

Matt

Share this post


Link to post
installpkg mysql-5.0.67-i486-1.tgz
[ ! -d /mnt/disk1/mysql ] && mkdir /mnt/disk1/mysql
chown -R mysql /mnt/disk1/mysql/
cp /etc/my-medium.cnf /etc/my.cnf
sed -i -e "s/#innodb_data_home_dir = \/var\/lib\/mysql\//innodb_data_home_dir =
sed -i -e "s/#innodb_log_group_home_dir = \/var\/lib\/mysql\//innodb_log_group_home_dir =
sed -i -e "s/#innodb_log_arch_dir = \/var\/lib\/mysql\//innodb_log_arch_dir =
[ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/
cd /usr ; /usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql &
[ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root password 'your_password'
[ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password
[ ! -d /mnt/disk1/mysql/Helium ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password
[ -d /mnt/disk1/mysql/Helium ] && mysql -u root -h Tower2 --password=your_password
[ -d /mnt/disk1/mysql/test ] && /usr/bin/mysqladmin -u root -h Tower2 -f --password=your_password
touch /mnt/disk1/mysql/.unmenu

Share this post


Link to post

sed -i -e "s/#innodb_data_home_dir = \/var\/lib\/mysql\//innodb_data_home_dir =
sed -i -e "s/#innodb_log_group_home_dir = \/var\/lib\/mysql\//innodb_log_group_home_dir =
sed -i -e "s/#innodb_log_arch_dir = \/var\/lib\/mysql\//innodb_log_arch_dir =
[ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/
cd /usr ; /usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql &
[ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root password 'your_password'
[ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password
[ ! -d /mnt/disk1/mysql/Helium ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password
[ -d /mnt/disk1/mysql/Helium ] && mysql -u root -h Tower2 --password=your_password
[ -d /mnt/disk1/mysql/test ] && /usr/bin/mysqladmin -u root -h Tower2 -f --password=your_password
touch /mnt/disk1/mysql/.unmenu

 

Here is a list of things which I found to be incorrect with your install file which have probably been either cut off or omitted during the copy/paste process.  You might want to have a look at your unmenu package file and ensure it is complete as outlined in the OP.

 

The error message you were receiving is exactly as I said, it was caused because the sed commands are incomplete.

 

The errors I found are outlined in red:

 

sed -i -e "s/#innodb_data_home_dir = \/var\/lib\/mysql\//innodb_data_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf

sed -i -e "s/#innodb_log_group_home_dir = \/var\/lib\/mysql\//innodb_log_group_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf

sed -i -e "s/#innodb_log_arch_dir = \/var\/lib\/mysql\//innodb_log_arch_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf

[ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/ --user=mysql

 

[ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password password 'your_password'

[ ! -d /mnt/disk1/mysql/Helium ] && /usr/bin/mysqladmin -u root -h Tower2 --password=your_password create Helium

 

Cheers,

Matt

 

 

Share this post


Link to post

Ah ha... thanks for that... it turns out the copy/paste had word wrapped when i put it in the .conf file... everytime i pressed install it would overwrite the .manual_install file :(

Share this post


Link to post

anyone know what this error means and how to get around it?

 

error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111'

 

mysql gets installed, and i can execute "mysql" from the command line, but i cant connect to it.

 

heres my mysql-unmenu-package.conf file

PACKAGE_NAME mysql (SQL-based relational database server)
PACKAGE_DESCR MySQL is a fast, multi-threaded, multi-user, and robust SQL
PACKAGE_DESCR (Structured Query Language) database server.  It comes with a nice API
PACKAGE_DESCR which makes it easy to integrate into other applications.
PACKAGE_DESCR The home page for MySQL is http://www.mysql.com/
PACKAGE_URL http://slackware.cs.utah.edu/pub/slackware/slackware/slackware/ap/mysql-5.0.67-i486-1.tgz
PACKAGE_FILE mysql-5.0.67-i486-1.tgz
PACKAGE_MD5 2152772395c13f5af16874760105a33d
PACKAGE_INSTALLED /usr/bin/mysql
PACKAGE_DEPENDENCIES none
PACKAGE_INSTALLATION installpkg mysql-5.0.67-i486-1.tgz
PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql ] && mkdir /mnt/disk1/mysql
PACKAGE_INSTALLATION chown -R mysql /mnt/disk1/mysql/
PACKAGE_INSTALLATION cp /etc/my-medium.cnf /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_data_home_dir = \/var\/lib\/mysql\//innodb_data_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_log_group_home_dir = \/var\/lib\/mysql\//innodb_log_group_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_log_arch_dir = \/var\/lib\/mysql\//innodb_log_arch_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/ --user=mysql
PACKAGE_INSTALLATION cd /usr ; /usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql &
PACKAGE_INSTALLATION [ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root password 'mypassword'
PACKAGE_INSTALLATION [ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root -h Tower --password=mypassword password 'mypassword'
PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql/VideosDB ] && /usr/bin/mysqladmin -u root -h Tower --password=mypassword create VideosDB
PACKAGE_INSTALLATION [ -d /mnt/disk1/mysql/VideosDB ] && mysql -u root -h Tower --password=mypassword --database=VideosDB -e "GRANT ALL PRIVILEGES ON VideosDB.* TO root@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;"
PACKAGE_INSTALLATION [ -d /mnt/disk1/mysql/test ] && /usr/bin/mysqladmin -u root -h Tower -f --password=mypassword drop test
PACKAGE_INSTALLATION touch /mnt/disk1/mysql/.unmenu
PACKAGE_VERSION_TEST mysql --version 2>&1 | grep Distrib | awk '{print $5}'
PACKAGE_VERSION_STRING 5.0.67,
PACKAGE_MEMORY_USAGE May be huge

and i have these directories in disk1

  • mysql/mysql
  • mysql/test
  • mysql/VideosDB

Share this post


Link to post

i just cant get this to go, every time i hit "Install mysql...." in the package manager in unmenu, unmenu stops responding, and i have to manually run /boot/unmenu/uu again to get it to respond.

 

and whenever i set it to auto reinstall (after manually restarting uu) it shows that error when unraid is booting up that i mentioned before.

 

my .conf is exactly a copy and paste from the very first post, except ive changed Tower2 to Tower. and still no joy.

 

surely it shouldnt be killing the unmenu webserver/whatever when its installing it right?  any tips to what i should be looking for?  im a complete linux n00b.

 

and can someone attach an actual complete mysql-unmenu-package.conf that works with the default settings of unraid (eg tower), so i know its not something just a stupid copy/paste error (which i doubt it is)

Share this post


Link to post

i just cant get this to go, every time i hit "Install mysql...." in the package manager in unmenu, unmenu stops responding, and i have to manually run /boot/unmenu/uu again to get it to respond.

 

and whenever i set it to auto reinstall (after manually restarting uu) it shows that error when unraid is booting up that i mentioned before.

 

my .conf is exactly a copy and paste from the very first post, except ive changed Tower2 to Tower. and still no joy.

 

surely it shouldnt be killing the unmenu webserver/whatever when its installing it right?  any tips to what i should be looking for?  im a complete linux n00b.

 

and can someone attach an actual complete mysql-unmenu-package.conf that works with the default settings of unraid (eg tower), so i know its not something just a stupid copy/paste error (which i doubt it is)

how much free memory do you have?

 

Since the installation consists of the lines in the .conf file prefaced with PACKAGE_INSTALLATION, simply take each line in turn (without the PACKAGE_INSTALLATION preface) and copy/paste it to your telnet window.

 

When you get to the line with the error, you will probably see an error message of some kind.  It could be as simple as you using an editor that puts carriage returns at the ends of the lines of the .conf file as you attempt to edit it to change the name of the server to Tower2.

 

Since mySQL can use a LOT of RAM, it could be as simple as not enough memory to run.  Or, it could be any number of items... but only you will know on your server which it is.

 

enter each line in turn on the command line after first changing directory to /boot/packages:

 

cd /boot/packages

 

installpkg mysql-5.0.67-i486-1.tgz

 

[ ! -d /mnt/disk1/mysql ] && mkdir /mnt/disk1/mysql

 

chown -R mysql /mnt/disk1/mysql/

 

cp /etc/my-medium.cnf /etc/my.cnf

 

sed -i -e "s/#innodb_data_home_dir = \/var\/lib\/mysql\//innodb_data_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf

 

sed -i -e "s/#innodb_log_group_home_dir = \/var\/lib\/mysql\//innodb_log_group_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf

 

sed -i -e "s/#innodb_log_arch_dir = \/var\/lib\/mysql\//innodb_log_arch_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf

 

[ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/ --user=mysql

 

cd /usr ; /usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql &

 

[ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root password 'mypassword'

 

[ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root -h Tower --password=mypassword password 'mypassword'

 

[ ! -d /mnt/disk1/mysql/VideosDB ] && /usr/bin/mysqladmin -u root -h Tower --password=mypassword create VideosDB

 

[ -d /mnt/disk1/mysql/VideosDB ] && mysql -u root -h Tower --password=mypassword --database=VideosDB -e "GRANT ALL PRIVILEGES ON VideosDB.* TO root@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;"

 

[ -d /mnt/disk1/mysql/test ] && /usr/bin/mysqladmin -u root -h Tower -f --password=mypassword drop test

 

touch /mnt/disk1/mysql/.unmenu

 

By eliminating unMENU entirely from the process, you can probably figure out what is happening.

 

Joe L.

Share this post


Link to post

ok, after days of trying to get this to work, i discovered it was a timing issue.

 

i put a couple of sleeps around a few lines

[ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/ --user=mysql
sleep 10
cd /usr ; /usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql &
sleep 10

and now it seems to reinstall and work after a reboot.

 

thanks for the help

Share this post


Link to post

ok, after days of trying to get this to work, i discovered it was a timing issue.

 

i put a couple of sleeps around a few lines

[ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/ --user=mysql
sleep 10
cd /usr ; /usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql &
sleep 10

and now it seems to reinstall and work after a reboot.

 

thanks for the help

That would explain why when you run each line in turn by hand on the command line, everything worked.  Good thinking.

 

Joe L.

Share this post


Link to post

Hi,

 

I've tried installing the mysql package, it did work once, but now I'm getting the following error

 

100309 12:43:30  mysqld started
100309 12:43:30 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
100309 12:43:30 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
100309 12:43:30  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /mnt/disk1/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
100309 12:43:30  mysqld ended

 

My package script is as follows

 

PACKAGE_NAME mysql (SQL-based relational database server)
PACKAGE_DESCR MySQL is a fast, multi-threaded, multi-user, and robust SQL
PACKAGE_DESCR (Structured Query Language) database server.  It comes with a nice API
PACKAGE_DESCR which makes it easy to integrate into other applications.
PACKAGE_DESCR The home page for MySQL is http://www.mysql.com/
PACKAGE_URL http://slackware.cs.utah.edu/pub/slackware/slackware-12.2/slackware/ap/mysql-5.0.67-i486-1.tgz
PACKAGE_FILE mysql-5.0.67-i486-1.tgz
PACKAGE_MD5 2152772395c13f5af16874760105a33d
PACKAGE_INSTALLED /usr/bin/mysql
PACKAGE_DEPENDENCIES none
PACKAGE_INSTALLATION installpkg mysql-5.0.67-i486-1.tgz
PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql ] && mkdir /mnt/disk1/mysql
PACKAGE_INSTALLATION chown -R mysql /mnt/disk1/mysql/
PACKAGE_INSTALLATION cp /etc/my-medium.cnf /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_data_home_dir = \/var\/lib\/mysql\//innodb_data_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_log_group_home_dir = \/var\/lib\/mysql\//innodb_log_group_home_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION sed -i -e "s/#innodb_log_arch_dir = \/var\/lib\/mysql\//innodb_log_arch_dir = \/mnt\/disk1\/mysql\//" /etc/my.cnf
PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql/mysql ] && /usr/bin/mysql_install_db --datadir=/mnt/disk1/mysql/ --user=mysql
PACKAGE_INSTALLATION sleep 10
PACKAGE_INSTALLATION cd /usr ; echo "/usr/bin/mysqld_safe --datadir=/mnt/disk1/mysql/ --user=mysql" | at now
PACKAGE_INSTALLATION sleep 10
PACKAGE_INSTALLATION [ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root password 'passworm'
PACKAGE_INSTALLATION [ ! -e /mnt/disk1/mysql/.unmenu ] && /usr/bin/mysqladmin -u root -h Tower --password=passworm password 'passworm'
PACKAGE_INSTALLATION [ ! -d /mnt/disk1/mysql/xbmcvideo ] && /usr/bin/mysqladmin -u root -h Tower --password=passworm create xbmcvideo
PACKAGE_INSTALLATION [ -d /mnt/disk1/mysql/xbmcvideo ] && mysql -u root -h Tower --password=passworm --database=xbmcvideo -e "GRANT ALL PRIVILEGES ON xbmcvideo.* TO root@'%' IDENTIFIED BY 'passworm' WITH GRANT OPTION;"
PACKAGE_INSTALLATION [ -d /mnt/disk1/mysql/test ] && /usr/bin/mysqladmin -u root -h Tower -f --password=passworm drop test
PACKAGE_INSTALLATION touch /mnt/disk1/mysql/.unmenu
PACKAGE_VERSION_TEST mysql --version 2>&1 | grep Distrib | awk '{print $5}'
PACKAGE_VERSION_STRING 5.0.67,
PACKAGE_MEMORY_USAGE May be huge

 

It would appear to be some sort of ownership problem. the mysql directory appear as a share on my network, but I disabled the export read/write within the shares menu as I didn't want the kids accidently deleting it.

 

The ls -l command shows

 

root@Tower:/mnt/disk1# ls -l
total 8
drwx------  2 root  root   96 Feb 27 03:40 Apps/
drwx------  3 root  root   72 Mar  9 05:14 Downloads/
drwx------  6 root  root  152 Mar  9 04:18 Games/
drwx------  2 root  root  168 Mar  9 05:14 Kids\ Stuff/
drwx------  2 root  root 3800 Mar  9 05:10 Movies/
drwx------ 35 root  root 1464 Feb 26 23:45 Music/
drwx------ 29 root  root 3384 Mar  1 20:07 Photos/
drwx------  2 root  root   48 Mar  9 05:41 TV\ Series/
drwxr-xr-x  4 mysql root  216 Mar  9 12:43 mysql/

 

Could any kind soul enlighten me where I've gone wrong?

 

Cheers

 

Glen.

 

 

Share this post


Link to post

If it helps I ended up running as root, as user "mysql" had insufficient privileges, despite issuing the chown for it. Works fine now. Just replace "mysql" user with "root".

 

I was advised elsewhere that this is not a problem as unraid runs eevrything as root anyway.

Share this post


Link to post

First off, thanks for creating this package!  Secondly, my question (that I couldn't find an answer to anywhere), how do you cleanly shutdown mysql? It is holding about a dozen files open on a mounted disk which keeps unraid from shutting down the array all the way.  For the one time this has been an issue I just did a killall mysqld and killall mysqld_safe to get the array unblocked for shutdown.  Thanks!

Share this post


Link to post

First off, thanks for creating this package!  Secondly, my question (that I couldn't find an answer to anywhere), how do you cleanly shutdown mysql? It is holding about a dozen files open on a mounted disk which keeps unraid from shutting down the array all the way.  For the one time this has been an issue I just did a killall mysqld and killall mysqld_safe to get the array unblocked for shutdown.  Thanks!

I think it installs a control file as /etc/rc.d/rc.mysql but does make it execuitable, therefore, just invoke it as an argument to "sh" like this:

sh  /etc/rc.d/rc.mysql  stop

 

If you make it executable you can invoke it directly as

/etc/rc.d/rc.mysql  stop

 

I have to warn you though, it is looking for a lock-file to exist first.  I don't know if this file ( /var/run/mysql/mysql.pid )  exists on your server once mysql is running, but even if it does, the way mysql is terminated in the script is by it invoking

killall mysqld  so, you might as well do exactly what you did last time you shut down the server, since that is exactly what it will do anyway.

 

excerpt from rc.mysql:

# If there is no PID file, ignore this request...

  if [ -r /var/run/mysql/mysql.pid ]; then

    killall mysqld

  fi

 

Joe L.

Share this post


Link to post

Thanks Joe, I just found the thread where you first discussed this (http://lime-technology.com/forum/index.php?topic=5611.15) sorry for the extra request.  I did notice in the rc.mysqld file that there is a commented out line that changes the permissions of the script to executable.  I uncommented the line and then stripped out (commented out actually) all the stuff in the stop function to simply do the killall command (because like you I never see the pid file running or not).

Share this post


Link to post

The link to the MySQL package in the OP is dead.  I found a newer one at the same site, but it is a .txz rather than .tgz and I don;t how to get it's MD5.  How can I get this to work?

Share this post


Link to post

The link to the MySQL package in the OP is dead.  I found a newer one at the same site, but it is a .txz rather than .tgz and I don;t how to get it's MD5.  How can I get this to work?

Links constantly change.

 

An updated install package for unMENU was just posted yesterday here: http://lime-technology.com/forum/index.php?topic=5568.msg59356#msg59356

 

You will need to upgrade to unmenu 1.3 to use it.  Instructions are here: http://lime-technology.com/forum/index.php?topic=5568.msg51814#msg51814

 

It has an updated link for the download, and a corrected and vastly easier setup screen using the new config variables now available under unMENU.

 

Joe L.

 

Share this post


Link to post

Thanks so much!  That worked great.  Your unmenu and the automated package installations are a god send.  I know next to nothing about Linux and I know without that I would've had to ask all kinds of questions on how to get MySQL all setup.  Thanks for all your work and help!

 

One question.  How can I approximate the amount of memeory MySQL will need?  I'm only using it for a centralized db for XBMC.  After scanning in my current library the db folder is ~16 MB.  Will the size of my db be a good ballpark figure, or is there a lot more overhead?

Share this post


Link to post

Thanks so much!  That worked great.  Your unmenu and the automated package installations are a god send.  I know next to nothing about Linux and I know without that I would've had to ask all kinds of questions on how to get MySQL all setup.  Thanks for all your work and help!

 

One question.  How can I approximate the amount of memeory MySQL will need?  I'm only using it for a centralized db for XBMC.  After scanning in my current library the db folder is ~16 MB.  Will the size of my db be a good ballpark figure, or is there a lot more overhead?

That is a mysql question...  I can't help you there.  When you learn, let us know.  I also will want to use it for a central DB for XBMC.

Share this post


Link to post

XBMC is my main use as well.  I have scanned in my whole video library (TV Shows mainly....currently re-ripping my DVD / Bluray discs), and plan on scanning in my Music library at some point too.  I'll do some testing and see how much memory is being used based off the size of my DB's, etc and will report back.

Share this post


Link to post

I am trying to set this up for my XBMC installation, I have installed the mysql package, and also edited the advancedsettings.xml to point to mysql.... but I have no idea if it is actually using it.  How do I know??

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.