I installed MySql on OpenWRT successfully without any errors - see below but I am having issues logging in - it's telling me access denied. But according to everything I found on the Internet, the default user name is root and there is no password so I must be a special case.
Please take a look below:
root@OpenWrt:~# mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h OpenWrt password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/scripts/mysqlbug script!
root@OpenWrt:~#
I then start the server:
root@OpenWrt:~# /usr/bin/mysqld &
root@OpenWrt:~# 160104 10:48:04 [Note] Event Scheduler: Loaded 0 events
160104 10:48:04 [Note] /usr/bin/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/run/mysqld.sock' port: 5158 Source distribution
Then I try to log on:
root@OpenWrt:~# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
root@OpenWrt:~#
I then tried:
root@OpenWrt:~# mysqladmin -u root -p root
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
root@OpenWrt:~#
In the above, for password I entered: "root" when it asked me for it. I also tried leaving it blank but no luck. I also tried ('new-password').
I have spent hours searching this site and other sites but none of the suggestions I've tried work. Also, in my case, mysqld_safe does not appear to be installed (and I don't believe it's available for OpenWRT).
Point of references: http://forums.mysql.com/read.php?34,140320,140324, http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html, How to find out the MySQL root password, 'Access denied for user 'root'@'localhost' (using password: NO)' and many other of which I lost track -- too many and none of them work.
Update
Please take a look below:
root@OpenWrt:~# /usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
root@OpenWrt:~# /usr/bin/mysqladmin -u root password 'root'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
root@OpenWrt:~# /usr/bin/mysqladmin -u root password 'admin'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
root@OpenWrt:~# mysqladmin reload
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
root@OpenWrt:~# /usr/bin/mysqladmin -u root password
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'