-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?

0

1 Answer 1

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/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.