如果窗口不能缩放,需要点击自动缩放模式。
如果主机不能ssh访问虚拟机,需要先配置端口转发,然后安装openssh-server(apt-get install openssh-server 如果ssh localhost失败就是没有安装)
# 备份原来的源
sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
# 添加源
sudo echo "deb <http://mirrors.aliyun.com/ubuntu/> bionic main restricted universe multiverse" >> /etc/apt/sources.list
sudo echo "deb-src <http://mirrors.aliyun.com/ubuntu/> bionic main restricted universe multiverse" >> /etc/apt/sources.list
# 更新源
sudo apt-get update
# 安装常用软件
sudo apt-get git
# 安装依赖
sudo apt-get install gnupg
# 下载配置类
wget <https://repo.mysql.com//mysql-apt-config_0.8.19-1_all.deb>
# 安装配置类
sudo dpkg -i mysql-apt-config_0.8.19-1_all.deb
# 如果报错:EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering
# 删除过期秘钥匙
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8C718D3B5072E1F5
# 正式安装mysql,注意看如果没有mysql 5.xx应该就是mysql8了
sudo apt-get install mysql-server
# 查看mysql状态
systemctl status mysql
# root链接mysql
mysql -uroot -p
连接 mysql时:Host 'gateway' is not allowed to connect to this MySQL server;
mysql> use mysql;
Database changed
mysql> select 'host' from user where user='root'
-> ;
+------+
| host |
+------+
| host |
+------+
1 row in set (0.00 sec)
mysql> update user set host = '%' where user ='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> select 'host' from user where user='root';
+------+
| host |
+------+
| host |
+------+
1 row in set (0.00 sec)
mysql> select 'host' from user where user='root';
+------+
| host |
+------+
| host |
+------+
1 row in set (0.00 sec)
# 安装JDK17
wget <https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz>
tar xvf openjdk-17.0.2_linux-x64_bin.tar.gz
echo 'export JAVA_HOME=~opt/jdk-17.0.2' | tee -a ~/.bashrc
echo 'export PATH=$PATH:$JAVA_HOME/bin '|tee -a ~/.bashrc
source ~/.bashrc