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

前端 未结 10 580
灰色年华
灰色年华 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:33

    To create user for phpMyAdmin :

    sudo mysql -p -u root
    

    Now you can add a new MySQL user with the username of your choice.

    CREATE USER 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD';
    

    And finally grant superuser privileges to the user you just created.

    GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' WITH GRANT OPTION;
    

    For any question, please leave a comment

提交回复
热议问题