mysql随手记

grant all privileges on *.* to 'root'@'%' with grant option;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '****' WITH GRANT OPTION;

修改root密码

     1.登录mysql

     > mysql -u root -p

      输入密码

    2.

   >use mysql

    重置密码

     > update user set authentication_string='' where user='root';

     >flush privileges;

    >select user,host from user;

    ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123';

posted @ 2023-06-20 17:32  谁主沉浮1226  阅读(3)  评论(0编辑  收藏  举报