2

So I just installed mariadb in a new server as always, but it seems none of my commands I used to set root password and allow remote root logins work anymore and googling isn't helping me much.

mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; FLUSH PRIVILEGES;"


mysql -u root -e "use mysql;update user set authentication_string=password('password') where user='root';FLUSH PRIVILEGES;"


mysql -u root -e "use mysql;UPDATE user SET plugin='mysql_native_password' WHERE User='root';FLUSH PRIVILEGES;"

This is what I used on my ssh terminal to allow remote access to root using a password. How can I do this in this new version?

Freedo
  • 206
  • 2
  • 10

2 Answers2

3

You are suppose to run mysql_upgrade command for Mariadb instance. Command is as following :

mysql_upgrade [--force] [--user=# --password 
  --host=hostname --port=# --socket=#
  --protocol=tcp|socket|pipe|memory 
  --verbose]
JYOTI RAJAI
  • 866
  • 4
  • 11
3

use

SET PASSWORD FOR user@localhost =  PASSWORD('passwordUwant') ;

the cause of this problem is because user is a 'view' now source: https://mariadb.com/kb/pt-br/set-password/

user201553
  • 31
  • 1