我正在尝试在OpenWrt上安装mysql-server。
mysql_install_db --force给了我错误:
/ usr / bin / my_print_defaults:无法加载库'libnsl.so.0'
致命错误:找不到/ usr / lib / mysqld
如果从源代码编译,则需要运行“make install”进行复制 将软件放入正确的位置以备操作。
如果您使用的是二进制版本,则必须位于顶层 提取的存档,或传递指向的--basedir选项 那个位置。
我已经安装了Libc,但我可以在/ usr / lib
下找到libnsl.so.0我在/ etc /
下有my.cnfmy.cnf的内容:
root@OpenWrt:/etc# cat my.cnf
[client]
port = 3306
socket = /var/run/mysqld.sock
[mysqld]
user = root
socket = /var/run/mysqld.sock
port = 3306
basedir = /usr
############ Don't put this on the NAND #############
# Figure out where you are going to put the databases
# And run mysql_install_db --force
datadir = /mnt/data/mysql/
######### This should also not go on the NAND #######
tmpdir = /mnt/data/tmp/
skip-external-locking
bind-address = 127.0.0.1
# Fine Tuning
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
# The following can be used as easy to replay backup logs or for replication.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
#expire_logs_days = 10
#max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
我还创建了mkdir / usr / lib / mysqld文件夹。
drwxr-xr-x 2 root root 4096 Mar 19 17:39 mysqld
然后我收到错误:
/usr/bin/my_print_defaults: can't load library 'libnsl.so.0'
Installing MySQL system tables...
/usr/bin/mysql_install_db: line 418: /usr/lib/mysqld: Permission denied
Installation of system tables failed! Examine the logs in
/var for more information.
You can try to start the mysqld daemon with:
shell> /usr/lib/mysqld --skip-grant &
and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var that may be helpful.
Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/bin/mysqlbug script!
我也尝试过: cd / usr / lib wget http://trac.augsburg.freifunk.net/export/3/trunk/freifunk-openwrt-kit-1.6.20-de/root/lib/libnsl.so.0 libnsl.so.0
然后我收到错误:
'/usr/lib/libnsl.so.0' is not an ELF file
我不知道该怎么办。 请给我一些想法!谢谢!
更新: 我更新了opkg.conf 删除了mysql-server 并且从opkg.conf中提供的新url中输入mysql-server
mysql_install_db现在很棒。 我可以启动mysqld而不会出现错误但是
我不能改变根本密码
/usr/bin/mysqladmin -u root password 'xxxxxxxxx'
/usr/bin/mysqladmin: can't load library 'libnsl.so.0'
更改mysql root密码的其他任何选项?
UPDATE2:
WORKS !!!!