启动mysql+远程连接
查看mysql服务状态
systemctl status mysqld
停止mysql服务
systemctl stop mysqld
重启mysql服务
service mysqld restart
启动mysql服务
systemctl start mysqld
登录mysql
mysql -uroot -p
修改设置密码的规则
set global validate_password_length=4;
长度最低位数
set global validate_password_policy=LOW;
修改密码
set password = password('123456');
开启访问权限
grant all on *.* to 'root'@'%' identified by '123456';
GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
刷新MySQL的系统权限相关表,否则会出现拒绝访问
flush privileges;
启动Tomcat
关闭防火墙
systemctl stop firewalld
启动tomcat
进入Tomcat的bin目录启动服务
cd /usr/local/apache-tomcat-7.0.57/ cd bin
启动
sh startup.sh或者./startup.sh
防火墙操作
查看防火墙状态
systemctl status firewalld / firewall-cmd --state
暂时关闭防火墙
systemctl stop firewalld
永久关闭防火墙(禁用开机自启)
==下次启动,才生效==
systemctl disable firewalld
永久开启防火墙(启用开机自启)
==下次启动,才生效==
systemctl enable firewalld
开放指定端口
==需要重新加载生效==
firewall-cmd --zone=public --add-port=8080/tcp --permanent
关闭指定端口
==需要重新加载生效==
firewall-cmd --zone=public --remove-port=8080/tcp --permanent
立即生效(重新加载)
firewall-cmd --reload
查看开放端口
firewall-cmd --zone=public --list-ports
杀死端口
查询某个进程占用端口
ps -ef |grep tomcat
杀死占用进程的端口
kill -9 PID