?ubuntu忘记用户密码看这里,真的不错,一文重置密码
在虚拟机ubuntu上安装ssh
sudo apt-get install ssh openssh-server
出现以下错误
Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/cache/apt/archives/
您看到此错误是因为其他程序正在尝试更新 Ubuntu。当命令或应用程序更新系统或安装新软件时,它会锁定?文件,所以需要等更新完成之后才能继续。
设置权限也报错。。。。
mysql> GRANT ALL PRIVILEGES ON *.* 'root'@'%' IDENTIFIED BY 'Eastcom@123' WITH GRANT OPTION;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''root'@'%' IDENTIFIED BY 'Eastcom@123' WITH GRANT OPTION' at line 1
解决办法:
这条语句适用于MySQL8.0之前的,而MySQL8.0及之后的,设置远程连接权限要用下面的语句才可以:
create user root@'%' identified by '123456';
grant all privileges on *.* to root@'%' with grant option;