0
$ mysqladmin -u root -p'cwY+nbtxt3w' password newpass

Old password is a temporary password by MySQL (in the screenshot below). MySQL is running in settings.

Get errors and warnings :

mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

Can you explain how to deal with that?

[1]: https://i.stack.imgur.com/4FWqV.jpg

  • 1
    You need to execute the command line you showed as the root. – user207421 Jul 15 '16 at 01:14
  • 1
    ditch the single quotes. Jam the password right next to the `-p` – Drew Jul 15 '16 at 01:15
  • To change a password, I would go into `mysql -uroot -p`, enter the password when prompted, and follow the instructions in [The manual page](http://dev.mysql.com/doc/refman/5.7/en/set-password.html) – Drew Jul 15 '16 at 01:16
  • 1
    perhaps an issue of localhost vs. 127.0.0.1, try http://stackoverflow.com/a/33332443 , the `-h` issue. – Drew Jul 15 '16 at 01:20
  • @Drew the problem is when I do mysql -uroot -p and type a temporary pass, I get the same error –  Jul 15 '16 at 01:20
  • @Drew the link didn't help also –  Jul 15 '16 at 01:23
  • 1
    ok, perhaps the cnf file and skip grants, that one. Which embarrassingly was similar to my most up voted answer once. Like, the [2nd Half](http://stackoverflow.com/a/31394469) of that answer. Some people don't have access to `mysqld_safe` depending on the distro. – Drew Jul 15 '16 at 01:24
  • @Drew I tried that method, but received `mysqld_safe.pid: Permission denied` –  Jul 15 '16 at 01:39
  • @Drew Could I miss something? –  Jul 15 '16 at 01:39
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/117364/discussion-between-drew-and-vinand). – Drew Jul 15 '16 at 01:43
  • 1
    Hello? Anybody home? This is all irrelevant. *You need to execute the command line you showed as the root.* With `sudo`, for example. – user207421 Jul 15 '16 at 02:19
  • I am confident that when he explains the steps he took to solve it, that it all falls into the category of relevant. – Drew Jul 15 '16 at 02:25
  • @Drew Unless and unless he does it my way it will never work. – user207421 Jul 15 '16 at 03:07
  • @EJP I have performed a ton of "I cannot login to my server" questions, and I am delighted to ping you every time I see one. Just point us at some of your answers to them. – Drew Jul 15 '16 at 03:15

0 Answers0