Access denied for user 'root'@'localhost' to database 'nextcloud'

Okay thanks @kanhu and @Aleks it works :grinning:

Resume

Clear MySQL with

  • mv /var/lib/mysql
  • apt-get install --reinstall mariadb-server
  • yunohost tools regen-conf -f mysql
  • yunohost service restart mysql
  • get password from `cat /etc/yunohost/mysql``
# reset password
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '<password>';

# first (not sure it was useful)
UPDATE user SET plugin='mysql_native_password' WHERE User='root';

# then 
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';
FLUSH PRIVILEGES;
GRANT ALL ON *.* TO 'root'@'localhost';

# then
mysql restart
1 Like