-1

I have installed MariaDB-server(10.1.34) freshly on Linux Ubuntu 18.04

I have started a SQL shell with:

sudo -i
mysql -uroot -p -h localhost

The shell opens. I want to change my password to be compatible with Node.js typeorm and mysql driver(as I always get this error) with the following:

ALTER USER root@localhost IDENTIFIED BY '12345';

And it always says I have an error in my syntax but I checked online and it's even on MariaDBs ALTER USER site. What is going wrong here? I tried:

ALTER USER root@localhost IDENTIFIED BY '12345';
ALTER USER 'root'@'localhost' IDENTIFIED BY '12345';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '12345';
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY '12345';
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY '12345';

But nothing works. I always get a syntax error, but I don't know where I made a mistake. Can someone point out my mistake?

Keya Kersting
  • 135
  • 1
  • 1
  • 8

1 Answers1

0

From https://mariadb.com/kb/en/library/alter-user/ :

The ALTER USER statement was introduced in MariaDB 10.2.0.

See also the older SET PASSWORD: https://mariadb.com/kb/en/library/set-password/

Rick James
  • 135,179
  • 13
  • 127
  • 222