找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 4401|回复: 7

openwrt 安装mysql环境出错,请大佬们看一下怎么办

[复制链接]
发表于 2018-12-5 17:31 | 显示全部楼层 |阅读模式
安装了 如下包  

  1. opkg install libpthread libncurses libreadline mysql-server
复制代码


该错误是执行数据库初始化发生的

  1. root@OpenWrt:~# mysql_install_db --force

  2. FATAL ERROR: Could not find ./bin/my_print_defaults

  3. If you compiled from source, you need to either run 'make install' to
  4. copy the software into the correct location ready for operation.
  5. If you don't want to do a full install, you can use the --srcdir
  6. option to only install the mysql database and privilege tables

  7. If you compiled from source, you need to either run 'make install' to
  8. copy the software into the correct location ready for operation.
  9. If you don't want to do a full install, you can use the --srcdir
  10. option to only install the mysql database and privilege tables

  11. If you are using a binary release, you must either be at the top
  12. level of the extracted archive, or pass the --basedir option
  13. pointing to that location.

  14. The latest information about mysql_install_db is available at
  15. https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
  16. root@OpenWrt:~# sed -i 's,^datadir.*,datadir         = "/srv/mysql",g' /etc/my.c
  17. nf
  18. sed: /etc/my.cnf: No such file or directory
  19. root@OpenWrt:~# sed -i 's,^tmpdir.*,tmpdir          = "/tmp",g' /etc/my.cnf
  20. sed: /etc/my.cnf: No such file or directory
  21. root@OpenWrt:~# /etc/init.d/mysqld start
  22. root@OpenWrt:~# /etc/init.d/mysqld enable
  23. root@OpenWrt:~# mysqladmin -u root password '123456'
  24. -ash: mysqladmin: not found
  25. root@OpenWrt:~# /etc/init.d/mysqld start
  26. root@OpenWrt:~# /usr/bin/mysqladmin -u root password 123456
  27. -ash: /usr/bin/mysqladmin: not found
复制代码
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
发表于 2018-12-5 18:31 来自手机 | 显示全部楼层
新版本MySQL安装完就自动运行了。需要先停止运行再创建数据库

点评

请问新版本的mysql包名是啥?  详情 回复 发表于 2018-12-6 11:44
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-12-6 11:44 | 显示全部楼层
99010 发表于 2018-12-5 18:31
新版本MySQL安装完就自动运行了。需要先停止运行再创建数据库

请问新版本的mysql包名是啥?
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

发表于 2018-12-21 23:49 | 显示全部楼层
我也遇到了这个问题,解决方法是ln -s /usr/bin/mysql** /bin/*
但是这步解决了,下一步就遇到了
  1. Installing MariaDB/MySQL system tables in '/mnt/sda1/data/mysql' ...
  2. 2018-12-21 15:48:25 2012630296 [ERROR] InnoDB: Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
  3. 2018-12-21 15:48:25 2012630296 [Warning] InnoDB: Linux Native AIO disabled.
  4. 2018-12-21 15:48:25 2012630296 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
  5. 2018-12-21 15:48:25 2012630296 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
  6. 2018-12-21 15:48:26 2012630296 [ERROR] Plugin 'InnoDB' init function returned error.
  7. 2018-12-21 15:48:26 2012630296 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  8. 2018-12-21 15:48:26 2012630296 [ERROR] Unknown/unsupported storage engine: InnoDB
  9. 2018-12-21 15:48:26 2012630296 [ERROR] Aborting


  10. Installation of system tables failed!  Examine the logs in
  11. /mnt/sda1/data/mysql for more information.

  12. The problem could be conflicting information in an external
  13. my.cnf files. You can ignore these by doing:

  14.     shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf

  15. You can also try to start the mysqld daemon with:

  16.     shell> /usr/bin/mysqld --skip-grant-tables --general-log &

  17. and use the command line tool /usr/bin/mysql
  18. to connect to the mysql database and look at the grant tables:

  19.     shell> /usr/bin/mysql -u root mysql
  20.     mysql> show tables;

  21. Try 'mysqld --help' if you have problems with paths.  Using
  22. --general-log gives you a log in /mnt/sda1/data/mysql that may be helpful.

  23. The latest information about mysql_install_db is available at
  24. https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
  25. You can find the latest source at https://downloads.mariadb.org and
  26. the maria-discuss email list at https://launchpad.net/~maria-discuss

  27. Please check all of the above before submitting a bug report
  28. at http://mariadb.org/jira
复制代码

原因是我安装的东西变成了mariadb了,,

点评

你好,我现在也是遇到了这个问题。请问你解决了吗? 这是我的邮箱  详情 回复 发表于 2019-1-5 13:14
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

发表于 2019-1-5 13:14 | 显示全部楼层
kangdei 发表于 2018-12-21 23:49
我也遇到了这个问题,解决方法是ln -s /usr/bin/mysql** /bin/*
但是这步解决了,下一步就遇到了

你好,我现在也是遇到了这个问题。请问你解决了吗? liunaijie1996@163.com这是我的邮箱

点评

我没有解决问题,你解决了php7的配置了没有  详情 回复 发表于 2019-1-5 17:54
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

发表于 2019-1-5 17:54 | 显示全部楼层
liunaijie 发表于 2019-1-5 13:14
你好,我现在也是遇到了这个问题。请问你解决了吗? 这是我的邮箱

我没有解决问题,你解决了php7的配置了没有

点评

我没有打算用php,所有没有安装  详情 回复 发表于 2019-1-7 14:28
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

发表于 2019-1-7 14:28 | 显示全部楼层
kangdei 发表于 2019-1-5 17:54
我没有解决问题,你解决了php7的配置了没有

我没有打算用php,所有没有安装
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

发表于 2019-1-20 15:47 | 显示全部楼层
这一步在命令后面加一个,这个意思是指定mysql的安装目录,那个目录不一定是usr,每个人可能不同
  1. --basedir=/usr
复制代码
完整的命令如下:
  1. /etc/mysql# mysql_install_db --basedir=/usr --force
复制代码
但是,后面又来新问题了,提示不支持本地AIO接口。这问题我就不会了。还请大佬帮忙看看。
  1. root@OpenWrt:/etc/mysql# mysql_install_db --basedir=/usr --force
  2. Installing MariaDB/MySQL system tables in '/overlay/mnt/data/mysql' ...
  3. 2019-01-20 15:37:34 2013162776 [ERROR] InnoDB: Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
  4. 2019-01-20 15:37:34 2013162776 [Warning] InnoDB: Linux Native AIO disabled.
  5. 2019-01-20 15:37:34 2013162776 [ERROR] InnoDB: mmap(136183808 bytes) failed; errno 12
  6. 2019-01-20 15:37:34 2013162776 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
  7. 2019-01-20 15:37:34 2013162776 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
  8. 2019-01-20 15:37:34 2013162776 [ERROR] Plugin 'InnoDB' init function returned error.
  9. 2019-01-20 15:37:34 2013162776 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  10. 2019-01-20 15:37:34 2013162776 [ERROR] mysqld: Out of memory (Needed 130760704 bytes)
  11. 2019-01-20 15:37:34 2013162776 [ERROR] mysqld: Out of memory (Needed 98058240 bytes)
  12. 2019-01-20 15:37:34 2013162776 [ERROR] mysqld: Out of memory (Needed 73531392 bytes)
  13. 2019-01-20 15:37:34 2013162776 [ERROR] Unknown/unsupported storage engine: InnoDB
  14. 2019-01-20 15:37:34 2013162776 [ERROR] Aborting


  15. Installation of system tables failed!  Examine the logs in
  16. /overlay/mnt/data/mysql for more information.

  17. The problem could be conflicting information in an external
  18. my.cnf files. You can ignore these by doing:

  19.     shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf

  20. You can also try to start the mysqld daemon with:

  21.     shell> /usr/bin/mysqld --skip-grant-tables --general-log &

  22. and use the command line tool /usr/bin/mysql
  23. to connect to the mysql database and look at the grant tables:

  24.     shell> /usr/bin/mysql -u root mysql
  25.     mysql> show tables;

  26. Try 'mysqld --help' if you have problems with paths.  Using
  27. --general-log gives you a log in /overlay/mnt/data/mysql that may be helpful.

  28. The latest information about mysql_install_db is available at
  29. https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
  30. You can find the latest source at https://downloads.mariadb.org and
  31. the maria-discuss email list at https://launchpad.net/~maria-discuss

  32. Please check all of the above before submitting a bug report
  33. at http://mariadb.org/jira
复制代码
先说一下我的openwrt,是先把优盘作为了软件的安装目录,不知道这个会不会有影响。之前没这样才做,直接安装在flash里面的话,用mysql_install_db创建表的时候会提示储存空间不足。


luci里面也能检测到



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-9-28 11:41

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com

快速回复 返回顶部 返回列表