MySQL
From WL-HDD Wiki
| WL-HDD Contents |
|---|
| What is the WL-HDD |
| Features |
| Pro's/con's |
| Reviews |
| Hacking |
| Inserting the HDD |
| Hacking Guides |
| Basic setup guides |
| Packages guides |
| Requests |
| Troubleshooting |
| This Wiki |
| Credits |
| Editing help |
| Contact Me |
Contents |
[edit] Prerequisites
To complete this guide, the following is assumed:
| You are running Oleg's firmware (1.9.2.7-6b or later) |
| You have harddisk partitions up and running with an extended filesystem mounted to /opt |
| You have installed the Ipkg package system. |
| You have configured your partitions to automount. |
[edit] Installation
Install the new version of ipkg:
On a freshly formatted external filesystem, mounted on /opt, do the following...
- First create the directories needed:
mkdir /opt/tmp mkdir /opt/tmp/ipkg
- Now get the better version of ipkg and uclibc. The ipkg.sh below will complain about missing /opt/lib/ipkg/lists/wl500g, but there is no problem since we are installing straight from the ipkg files.
# Get the better version of ipkg wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-9_mipsel.ipk
- Install it (Ignore the missing lists/wl500g error)
ipkg.sh install ipkg-opt_0.99.163-9_mipsel.ipk
- Get the better version of uclibc
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk
- Now install it (Ignore the missing lists/wl500g error)
ipkg.sh install uclibc-opt_0.9.28-12_mipsel.ipk
- Update the list using the improved ipkg
ipkg update
Now upgrade your system:
ipkg upgrade ipkg list_installed ipkg install -force-reinstall 'all listed packages'
- This last command refers to the packages listed by the list_installed command. You need to update all of these packages. You do not however have to re-upgrade ipkg and uclibc, we have already done this.
[edit] Install MySQL
Lets install the package:
ipkg install mysql
Ignore the error messages.. We're still working on it!
[edit] Setup
Now for the 'hard' part. We'll have to change the name of 'admin' (default) into 'root' otherwise MySQL won't work.
Via a Web Browser:
- In your web browser, browse to the WL-HDD configuration pages, then to System and finally to Change Name. Make root the new name.
Via SSH or Telnet:
- Change the name of admin into root for Telnet (and/or SSH)
nano /etc/passwd
change the line:
admin:$1$uVp0rbe2$/pFIqeoCxe1spdyUOa6OP1:0:0:root:/usr/local/root:/bin/sh (note: the password hash will probably be different!!)
to
root:$1$uVp0rbe2$/pFIqeoCxe1spdyUOa6OP1:0:0:root:/usr/local/root:/bin/sh
To save this file:
CTRL + O (press Y) CTRL + X
Making it permanent:
- Enter the following commands, you only ever have to do the echo commands once on the WL-HDD - hence don't do it again if you have already done it before.
echo "/etc/passwd" >>/usr/local/.files echo "/etc/group" >>/usr/local/.files
Now lets commit to the flash.
flashfs save flashfs commit flashfs enable
Now lets reboot and re-login with root instead of admin.
[edit] Finishing off
All packages should be installed and almost ready to go. There are only a few things left to change and then we should be going...
The MySQL database directory is corrupted in some way. We can fix this by the following command:
rm /opt/var/lib/mysql/mysql/*.* rmdir /opt/var/lib/mysql/mysql
Then we'll rebuild the database again:
/opt/bin/mysql_install_db
Last (but not least):
chown -R root:root /opt/var/lib/mysql
[edit] Start MySQL
To start MySQL type:
/opt/etc/init.d/S70mysqld start
Now for security-reasons (obviously) CHANGE THE PASSWORD for the ROOT user:
- To do so, start the server, then issue the following commands:
/opt/bin/mysqladmin -u root password 'your-new-password' **
With my first installation something went wrong and I got an error about not being able to load the library libmysqlclient.so.14
- This is solved by typing:
ln -s /opt/lib/mysql/libmysqlclient.so /opt/lib/libmysqlclient.so.14 ((sym)link to the right library)
Note: MySQL is pretty heavy for a Asus WL-HDD. I've had it running for some time now and it's a bit slow. I wouldn't bother inputting large databases, however, for a simple homepage it's fine!
This guide was put together using this page and Google by Lucaspr.
Many thanks to the author from Jono 18:33, 7 March 2007 (GMT)
