无法在 Onion Omega IoT 板上安装 mysql

问题描述

我正在我的 Onion Omega2+ IoT 板上安装 MysqL。命令'opkg update && opkg install mariadb-client mariadb-server'安装MysqL,然后我通过shell运行命令MysqL,出现如下错误: 'MysqLd: datadir '/mnt/data/MysqL/' in '/etc/MysqL/my.cnf' 不存在'。 没有像 /mnt/data/MysqL/ 这样的目录,我改变了它。然后我通过终端运行命令 MysqL,它给出错误:ERROR 2002 (HY000): Can't connect to local MysqL server through socket '/var/run/MysqLd/MysqLd.sock' (2 "No such file or directory" )。我检查了目录 /var/run/MysqLd/MysqLd.sock 不存在,所以我也按照 error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' -- Missing /var/run/mysqld/mysqld.sock 创建了它 我检查了 /etc/MysqL/my.conf 文件并重新运行 'MysqL',最后出现这个错误 ERROR 2002 (HY000):无法通过套接字'/var/run/MysqLd/MysqLd.sock'连接到本地MysqL服务器(146“锁定超时;重试事务”) 我只在MysqL错误页面上发现这个错误,找不到原因,请帮忙 (也许有用:/var 目录实际上是 /tmp 的链接,还有另一个套接文件 /var/run/ubus.sock,所以我也尝试在该目录中创建套接文件,结果相同)

我的 my.cnf 文件看起来像:

[client]
port        = 3306
socket      = /var/run/MysqLd/MysqLd.sock

[MysqLd]
user        = mariadb
socket      = /var/run/MysqLd/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/mmcblk0p1/MysqL

######### This should also not go on the NAND #######
tmpdir      = /mnt/mmcblk0p1/MysqL

skip-external-locking

bind-address        = 127.0.0.1

# Fine Tuning
key_buffer_size     = 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

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)