4.1.1 创建tomcat文件夹 cd /usr/java #这里文件夹创建的路径可根据自己的习惯创建 mkdir tomcat #我默认把jdk文件夹和tomcat文件夹放在Java目录下
4.1.2 移动tomcat到指定文件夹下并解压 cd ~ #回到/root目录下 ls #找到上传的tomcat mv -i apache-tomcat-8.5.34.tar.gz /usr/java/tomcat #移动至指定位置 cd /usr/java/tomcat #进到tomcat文件夹下 ls #查看目录下文件 tar -zxvf apache-tomcat-8.5.34.tar.gz #解压文件
4.1.3 写入配置 ls #解压成功后,当前目录下出现apache-tomcat-8.5.34文件夹 cd apache-tomcat-8.5.34 #进入到文件夹bin目录下 cd bin # vim setclasspath.sh #编辑 setclasspath.sh 添加如下代码: export JAVA_HOME=/usr/java/jdk/jdk1.8.0_181 export JRE_HOME=/usr/java/jdk/jdk1.8.0_181/jre
5.4 启动MySQL、修改初始密码 #启动服务 sudo service mysqld start #查看初始密码 sudo grep 'temporary password' /var/log/mysqld.log #密码登录 mysql -u root -p #修改密码:密码长度至少8位,且包含大小写字母、数字、特殊字符组合 ALTER USER 'root'@'localhost' IDENTIFIED BY '你的密码';
1 2 3 4
5.5 #默认情况下密码策略要求密码至少包含一个大写字母、一个小写字母、一个数字和一个特殊字符,并且总密码长度至少为8个字符。 否则回报出:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
validate_password is installed by default. The default password policy implemented by validate_password requires that passwords contain at least one upper case letter, one lower case letter, one digit, and one special character, and that the total password length is at least 8 characters.
客户访问报错:ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL
解决方案: 服务端登陆MySQL,修改user表登陆用户的host。 shell> mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed mysql> show tables; +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | 此处省略n个表 | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 33 rows in set (0.00 sec)
mysql> update user set host='%' where user='root'; Query OK, 1 row affected (0.07 sec) Rows matched: 1 Changed: 1 Warnings: 0