0

i used the solution here ERROR 1045(28005) : Access denied for user 'root@localhost' (using password: no ) but when i use the command

UPDATE mysql.user SET Password=PASSWORD('000') WHERE User='root'; FLUSH PRIVILEGES; exit;

i get this

bash: syntax error near unexpected token `('
6
  • That is a mysql command, not a bash command. You run it at the mysql prompt. My guess is you skipped step 3, log into mysql as root.
    – Panther
    Jul 12, 2017 at 18:16
  • See also askubuntu.com/questions/428243/…
    – Panther
    Jul 12, 2017 at 18:17
  • i tried it and got ahmed@Anonymous:~$ sudo -i [sudo] password for ahmed: -bash: export: =/usr/lib/jvm/java-8-oracle': not a valid identifier root@Anonymous:~# UPDATE mysql.user SET authentication_string=PASSWORD('000'), plugin='mysql_native_password' WHERE User='root' AND Host='localhost'; -bash: syntax error near unexpected token (' Jul 12, 2017 at 18:33
  • You still skipped step 3 "mysql -u root mysql" . You will then get a mysql prompt mysql> . you enter the UPDATE command at the mysql prompt, not the bash prompt. Nowhere in the link you are following is the command "sudo -i" listed.
    – Panther
    Jul 12, 2017 at 18:35
  • how can i open mysql ptompt? when i used this mysql -u root mysql i got ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Jul 12, 2017 at 18:39

0

You must log in to answer this question.

Browse other questions tagged .