I am using OpenWrt in Arduino Yun. I want to save some sensors data into MySQL Server which is installed in OpenWrt localhost.
But it gives an error when I try to login MySQL after reboot the system.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld.sock' (2)
if i reinstall it start working but this error came after each reboot.
opkg update
opkg install mysql-server
sed -i 's,^datadir.*,datadir = "/srv/mysql",g' /etc/my.cnf
sed -i 's,^tmpdir.*,tmpdir = "/tmp",g' /etc/my.cnf
mkdir -p /srv/mysql
mysql_install_db --force
/etc/init.d/mysqld start
/etc/init.d/mysqld enable
please help me to resolve this issue so MySQL works every time after reboot also.