PDA

Bekijk de volledige versie : mysql



grifu
31-01-2007, 16:54
I have worked with WL-500gp asus firmware for some time, but didnīt like it, the download manager and the hd shares where slow, or didnīt work. So with a very few experience in linux, iīve follow the very good guides in this forum, to install the olegīs firmware, and other packadges.

1. Iīve set the wl500gp box with the Olegīs firmware 1.9.2.7-7f.
2. Connected and configured a usb hd (lacie 250gb) with samba share
3. Connected and configured a usb printer (cannon ip4300, mac users must upgrade drivers)
3. installed some packages (nano, midnight commander, torrent, ctorrent, cron, lighttp and php)
Amazing.....Everything works with pc and mac desktops (ethernet connection), pc and notebooks (wifi)
A very special thanks to Olegīs firmware, from a simple router we get a "powerful":D server

Now....just one more thing....i would like to install mysql server....
I search this and other foruns for mysql installation, and i get confused with the posts....
So, i install the mysql using the hmantsao post as guide line to see what happen



install mysql.
1. ipkg install mysql then will show error messages
2. ln -s /opt/lib/mysql/libmysqlclient.so /opt/lib/libmysqlclient.so.14
3. modify /opt/etc/my.cnf
;password = your passwd -> password = root
4. copy database which name is mysql from anywhere we can to /opt/var/lib/mysql/mysql/* , i copy the database from "appsrv<-w32 program"
5. /opt/libexec/mysqld &
6 ipkg install phpmyadmin
7. modify /opt/share/www/phpmyadmin/config.inc.php to add password.
$cfg['Servers'][$i]['password'] = 'root'; // MySQL password (only
8. now , you can try mysql in command mod or use phpmyadmin (please check your httpd location)
9 and try to use

as i showing before that still have many problem , need to check why can't create mysql database and why can't start mysql from /opt/etc/init.d/S70mysqld.

result.....erroorrs...:mad:

then, i start searching more....and in macsat a saw a post from peridoc and a reply from catalin P

peridoc
When installing the mysql package using ipkg I get the following:

Configuring mysql
Installing all prepared tables
Bad system call

and the install never completes. Has anyone else seen this when installing and gotten around it? Am I missing something to get mysql or postgres DB to install on the WLHDD?

Thanks!


Catalin P
I had the same problem with mysql 4.1.20 but with 4.1.16 works without problems.

Catalin P
Sorry, actually is not working...somehow the install said is ok but is not. Maybe somebody else found a solution?



Iīve tryed to find ou if there was a 4.1.16 pack of mysql, but no luck....justo the 4.1.20-1

Then....the uClibc++ library.....seems to be the solution....
hereīs a post from oleo in 07-03-2006:


After many hours I have managed to port uClibc++ library to 3.2.3 toolchain used to build Oleg firmware. This port enabled many previously non working optware packages to start working! (eg. python, py-*, mysql, ctorrent, groff, man, mutt, nmap, nload, nagios-plugins & nrpe, appweb, cdargs, cogito, cherokee, ruby, ...) Visit http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/ for complete list of packages.

See Optware wl-500g Build FAQ page for details of this wl500g toolchain upgrade.

THE QUESTION:

how to get mysql working (if possible) ?
do i need to change the uClibc++ ??
the post from oleo seems to be older than the latest olegīs firmware so it seems that this uClibc++ problem maybe not exist any longer...
Any help ?

oleo
31-01-2007, 19:25
Install packages with http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild
Mysql should work.

grifu
05-02-2007, 16:52
After reading the oleo reply (thanks), i made this steps:
use the http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild as guide to install the uclibc and reinstall every other packadges....

1. Tryed to remove the mysql package " ipkg remove mysql -force-depends"

2. Modify the ipkg configuration to receive the packīs from ".../optware/oleg/cross/stable"


Open the file /opt/etc/ipkg.conf in your favourite editor
Remove or comment out the line that specifies the current source for unslung packages (should start with "src unslung")
Define the new source for Unslung package by adding the line src unslung http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable
Make sure the destination is specified as follows:
dest root /

My /opt/etc/ipkg.conf:
---
src wl500g http://wl500g.dyndns.org/ipkg
src unslung http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable
dest root /
---

3. Install ipkg-opt_0.99.163-9 and the uclibc-opt_0.9.28-12


# get the better ipkg
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-9_mipsel.ipk
#install it (ignore tne missing lists/wl500g error)
ipkg.sh install ipkg-opt_0.99.163-9_mipsel.ipk

# get the better uclibc
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk
# install it (ignore tne missing lists/wl500g error)
ipkg.sh install uclibc-opt_0.9.28-12_mipsel.ipk

# update the list using the improved ipkg
ipkg update

4. List the installed packages and reinstall


Get a list of all packages you have currently installed with the command "ipkg list_installed"
For each of these packages reinstall the package with the command "ipkg install -force-reinstall package_name" (except for the uClibc package itself off course because you installed the correct version in the previous steps)

Afert doing this step i get duplicated packages (ipkg list_installed):

appweb - 2.1.0-1
bzip2 - 1.0.4-1
cron - 4.1-5 (DUPLICATED)
cron - 4.1-4
ctorrent - 1.3.4-2
cyrus-sasl-libs - 2.1.22-1
enhanced-ctorrent - dnh2.2-6
gdbm
glib - 2.6.6-3
ipkg - 0.99.149-2
ipkg-opt - 0.99.163-9
libbt - 1.05-5
libcurl - 7.16.0-4 (DUPLICATED)
libcurl - 7.16.1-1
libdb - 4.2.52-3
libstdc++ - 0.2.0-6
libuclibc++ - 0.2.2-4 (DUPLICATED)
libuclibc++ - 0.1.12-4
libxml2 - 2.6.27-2
libxslt - 1.1.20-1 (DUPLICATED)
libxslt - 1.1.19-1
lighttpd - 1.4.13-6 (DUPLICATED)
lighttpd - 1.4.13-7
mc - 4.5.55-6 (DUPLICATED)
mc - 4.1.35-3
mysql - 4.1.20-1
nano - 2.0.3-1 (DUPLICATED)
nano - 2.0.2-1
ncurses - 5.6-1
openldap-libs - 2.3.33-1
openssl - 0.9.7l-3
pcre - 6.7-4 (DUPLICATED)
pcre - 6.7-3 -
php - 5.2.0-4
php-embed - 5.2.0-4
php-fcgi - 5.2.0-5
php-mbstring - 5.2.0-4
php-mysql - 5.2.0-4
phpmyadmin - 2.6.2-2
readline - 5.2-2
torrent - 1.4-7
uclibc-opt - 0.9.28-12
zlib - 1.2.3-2

4. Install mysql again and....again :mad: :mad: ERROR
when starting mysql.................ERROR
if i type mysql in terminal i get:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
if i try to start mysql with
/opt/bin/mysqld_safe --skip-grant-tables
it starts, but:
chown: unknown user name: root
Starting mysqld daemon with databases from /opt/var/lib/mysql
Now: I can enter mysql even with phpadmin but with no security and i thinks is not working very good.....
I have changed the root password:
After runing /opt/bin/mysqld_safe --skip-grant-tables and opened another terminal and start:
/opt/bin/mysql -u root
use mysql;
update user set Password = PASSWORD('pass') where User ='root';
---
Query OK, 1 row affected (0.11 sec)
Rows matched: 1 Changed: 1 Warnings: 0
---
exit
/opt/etc/init.d/S70mysqld stop
---
mysqld ended
---
rm -f ~/.mysql_history
/opt/etc/init.d/S70mysqld start
---
Starting MySQL................................... ERROR!
---
if i open phpadmin, the page says:
MySQL said:

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
---
if i start mysql with /opt/bin/mysqld_safe --skip-grant-tables
i can open phpadmin but it also alertīs me with:
---
The $cfg['PmaAbsoluteUri'] directive MUST be set in your configuration file!
Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole.
---

Itīs possible to be a user problem or a database problem, iīve read some postīs about it.....that mysql doesnt create the correct databases....but i dont know....

anyway....going to search more, and try some more thingīs

Is it possible to remove the duplicated packages ?

oleo
05-02-2007, 18:52
add use root to /etc/passwd or chane admin to root.

If there are some other things We can help, but first to to create database from template, grant permissions and see if create table, select and other SQL commands work.

Then you can proceed to PHP!

If there are some scripts to corrent, please notify me!

grifu
06-02-2007, 19:24
I did change the router username from admin to root and now
when starting mysql with:

/opt/bin/mysqld_safe --skip-grant-tables

It starts well (without the error: chown: unknown user name: root)

But if i start with:

/opt/etc/init.d/S70mysqld start

i get:

Starting MySQL................................... ERROR!

in the log file asus.err
(opt/var/lib/mysql/asus.err)

070206 18:56:11 mysqld started
070206 18:56:13 [ERROR] /opt/libexec/mysqld: Incorrect information in file: './mysql/host.frm'

070206 18:56:13 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect information in file: './mysql/host.frm'
070206 18:56:13 mysqld ended

Now...i think this is the real problem, the mysql installation didnīt create the host.* files, so i tryed to copy from an mysql directory (windows) and
put those files in the reouter.....didnīt work....so...iīve created some
empty files (host) ...but....nothing....
How can i solve this ??

I also thought it could be a port problem, so i opened the 3306 in nat
but...no good results

iīll keep trying... (it must be the host files)....

oleo
06-02-2007, 21:51
Remove directory /opt/var/lib/mysql/mysql/

then issue
/opt/bin/mysql_install_db
and

chown -R root:root /opt/var/lib/mysql

grifu
07-02-2007, 13:41
Thanks a lot OLEO,

thatīs it.....now it works....
removing the mysql BAD.directory, and creating a Good one was the
the sollution.....
I hope that all this messages could help someone with the same problem...


PS: mysql runs a little slow....but....it works...:D
and im very happy about it....

oleo
09-02-2007, 01:26
Nice to hear that.

greengreen
10-02-2007, 16:04
HI,
I installed mysql and works but I can't change password. Itried:
/opt/bin/mysql -u root
update user set Password = PASSWORD('pass') where User ='root';
ERROR 1046 (3D000): No database selected


Any idea how to fix it?

thanks very much

oleo
10-02-2007, 19:35
Install packages with http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild
Mysql should work.

greengreen
11-02-2007, 08:02
thanks now is woking right.I forgot to use:use mysql
thanks

lucaspr
06-03-2007, 20:58
To make live a little easier... I made an HOW-TO....

Here it is.. If something should/could be changed let me now!

Howto install MySQL onto WL-HDD:

There are a few problems when you're ready to install MySQL. I hope you succeed in installing with this HOW-TO


Install new ipkg:

On a freshly formatted external filesystem, mounted on /opt, take the following steps...

First create the directory:
mkdir /opt/tmp
mkdir /opt/tmp/ipkg

Now get the beter ipkg an uClibc. The ipkg.sh below will complaining about missing /opt/lib/ipkg/lists/wl500g, but that is no problem since we are installing straight from the ipk files.

# get the better ipkg
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-9_mipsel.ipk
#install it (ignore tne missing lists/wl500g error)
ipkg.sh install ipkg-opt_0.99.163-9_mipsel.ipk

# get the better uclibc
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk
# install it (ignore tne 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-THE-INSTALLED-PACKAGES' # These are listed in the previous command! Except for ipkg and uclibc (You already upgraded these remember??)

Now install Mysql

ipkg install mysql

ignore the error messages.. We're still working on it!

Now for the 'hard' part. We'll have to change the name of 'admin' (default) into 'root' otherwise mysql won't work.

(COnfig pages of WL-HDD, system -> change name)

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 passwordhash should be different!!)

into

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:

flashfs save
flashfs commit
flashfs enable

reboot and re-login with root instead of admin.

All packages should be installed and almost ready to go. Only a few things left to change and 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 to rebuild this database:
/opt/bin/mysql_install_db

at last (but not least):

chown -R root:root /opt/var/lib/mysql

Then 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 can't load 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 got it running some time now and it's running a bit slow. Don't think about putting in large databases. For a simple homepage it's fine!

This howto is made from this page and google: