Compared to the last time I was looking at doing this, the installation and setup is now a breeze, all thanks to fonz for creating a funplug package for it:
- Download the package from fonz's website
# wget http://www.inreto.de/dns323/fun-plug/0.5/packages/mysql-5.0.67-2.tgz
- Install the package
# funpkg -i mysql-5.0.67-2.tgz
- Setup the MySQL config file using the small version of the included examples (remember that the DNS-323 has limited resources)
# cp -a /ffp/etc/examples/mysql/my-small.cnf /ffp/etc/my.cnf
- Define a storage location for your database files in the config file. For me, I have it on my USB stick as my usage pattern is mostly reads and I want to my HDD to remain in spin down state longer. Add in my.cnf after [mysqld] : datadir = /ffp/var/mysql
- Initialize MySQL
# mysql_install_db
- Now create a database and have fun!
# mysql -u root -p
Enter password: your_root_password
mysql> create database testdb;
mysql> grant all on testdbuser.* to testdb identified by 'your_password';
mysql> flush privileges;
mysql> quit - In case of errors, look up the log found in /ffp/var/mysql/[replace with your hostname].err
Besides using it with SqueezeCenter, I intend to also use it for some web-app projects (e.g. Joomla!). Stay tuned!
4 comments:
What about creating and setting up a mysql user (and changing ownership of mysql directories:
chown -R mysql /ffp/var/run/mysql
chown -R mysql /ffp/var/mysql
Is it required? Did I need to do it to start mysql running?
Thanks
Y
Also, the following error:
root@dlink-XXXX:/mnt/HD_a2/ffp/var/mysql# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
means password wasn't set for root user
/ffp/bin/mysqladmin -u root password 'passcomeshere'
This is probably a mysql standard routine, but since I, and probably others might not be mysql admins, can be a showstopper.
Cheers
On DNS-320, the install script isn't complete. You must first create the mysql user, and THEN run the install script :
useradd -U -s /bin/false mysql
funpkg -i mysql-5.0.67-2.tgz
And, once the install is over, the init script must be made executable so mysql is launched automatically at boot time of the NAS :
chmod a+x /ffp/start/mysqld.sh
on:
"# mysql -u root -p"
i get an error 2002 (HY000): Cant connect...
should i type a command :
"sh mysql.sh start" ?
thanks in advance.
PARUSA
Post a Comment