0

I finally decided to post my question as I am encountering high difficulties to connect to the mysql client.

I am using a mySQL database on an OpenWRT OS installed on an Arduino Yun.

I cannot log into mySQL as root, the following error message is displayed:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I tried with suffix -u root (or -uroot) and suffix -p and a supposed password but every time it turns out to be the same error, sometimes with (using password: NO), other times with (using password: YES)

Reading some posts, I tried all the following manipulation :

kill mysqld and then run

mysqld with --skip-grant-tables

It works and I can log into mysql but any operation proposed to UPDATE the password for user root turns a QUERY OK with 0 rows modified. It should be normal I suppose, as I am not log with grant tables I have no access to user informations and privileges.

Note that when I run

SELECT user();

or

SELECT current_user();

I get root@ with nothing following.

Re-installing the databases using the script mysql_install_db. It does not work as is saying that no host "Arduino" or "localhost"could be looked up with /usr/bin/resolveip (nota: no such thing in that folder) using the --force option it works.

I tried what is exposed in the following post SOLVED - MySQL - Can't Log In - Access Denied - Brand New Installation (OpenWRT)

With the command line

mysqladmin -uroot password pwd

I ended with the same answer :

error: 'Access denied for user 'root'@'localhost' (using password: NO)'

Could anybody help me or tell me what is the cleanest way to uninstall and fully reinstall MySQL on OpenWRT?

Thank you

Community
  • 1
  • 1
AtoM_84
  • 145
  • 1
  • 3
  • 10

1 Answers1

1

Well, yeah...

mysqladmin -uroot password pwd
                  ^--missing --

Since you don't specify the password option correctly, you're effectively passing NO password to mysqladmin, and it doesn't log you in.

Try

mysqladmin -u root -p pwd
mysqladmin --user=root --password=pwd

instead.

Marc B
  • 356,200
  • 43
  • 426
  • 500
  • Anyway the result i always the same error 'Access denied for user 'root'@'localhost' (using password: YES). It does not declare a bad formulation of my command verbosing the help. In this post http://stackoverflow.com/questions/34589871/solved-mysql-cant-log-in-access-denied-brand-new-installation-openwrt?noredirect=1&lq=1 the questioner answers himself his question and I suppose I have the same issue but it did not say how to cleanly remove mySQL. could you tell me? – AtoM_84 Aug 30 '16 at 16:37