SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

前端 未结 10 592
灰色年华
灰色年华 2020-12-04 12:49

I just installed Ubuntu 16.04 and installed web server on it. Everything works well, but I cannot access database. Even if I create new user and grant all privileges, I can\

10条回答
  •  我在风中等你
    2020-12-04 13:44

    In short, on MariaDB

    1) sudo mysql -u root;
    2) use mysql;
    3) UPDATE mysql.user SET plugin = 'mysql_native_password', 
          Password = PASSWORD('pass1234') WHERE User = 'root';
    4) FLUSH PRIVILEGES;
    5) exit;
    

提交回复
热议问题