登陆
最新消息: 老是忘了更新啊~~


Netgear wndr4300路由器OpenWrt固件安装Mysql数据库

技巧资料 骑猪看月亮 5810次浏览 1条评 论

1. 用opkg安装myserver及其依赖包

连接openwrt
opkg update
opkg install libpthread libncurses libreadline mysql-server
2. 创建mysql数据目录
mkdir -p /mnt/data/mysql
mkdir -p /mnt/data/tmp
3. 修改配置文件
vi /etc/my.cnf
datadir = /mnt/data/mysql/ #数据保存路径
tmpdir = /mnt/data/tmp/
bind-address = 0.0.0.0 #绑定的ip地址
4. 初始化建库
mysql_install_db --force
5. 启动mysql,并设定开机启动
/etc/init.d/mysqld start
/etc/init.d/mysqld enable
6. 登陆Mysql,设定密码 

 openwrt设置mysql

/usr/bin/mysqladmin -u root password
mysqladmin -u root password 'new-password'

 

囧 亲 晕 酷 哭 馋 闭嘴 调皮 贪 奸 怒 嘿 羞 汗 色 惊 萌 悲 笑 惊 狂 吃
囧 亲 晕 酷 哭 馋 闭嘴 调皮 贪 奸 怒 嘿 羞 汗 色 惊 萌 悲 笑 惊 狂 吃

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论(1)

  1. avatar
    我安装mysql-server的时候报错……初始化数据库就system tables安装失败(;´Д`)请教一下怎么解决呢,谢谢!
    ~# opkg install /tmp/mysql-server_5.1.73-1_ar71xx.ipk
    Installing mysql-server (5.1.73-1) to root...
    Configuring mysql-server.
    /etc/init.d/mysqld: Error: I didn't detect a privileges table, you might need to run mysql_install_db --force to initialize the system tables
    Collected errors:
    * resolve_conffiles: Existing conffile /etc/my.cnf is different from the conffile in the new package. The new conffile will be placed at /etc/my.cnf-opkg.

    ~# mysql_install_db --force
    Installing MySQL system tables...
    /usr/bin/mysqld: can't load library 'libc.so'

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

    You can try to start the mysqld daemon with:

        shell> /usr/bin/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 /mnt/sda1/mysql/ 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/scripts/mysqlbug script!
    annadst 2016-12-01 18:16 回复