Linux常用指令

本文涉及的产品
云数据库 RDS MySQL,集群版 2核4GB 100GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,高可用版 2核4GB 50GB
简介: Linux常用指令

 启动mysql+远程连接

查看mysql服务状态

systemctl status mysqld

image.gif

停止mysql服务

systemctl stop mysqld

image.gif

重启mysql服务

service mysqld restart

image.gif

启动mysql服务

systemctl start mysqld

image.gif

登录mysql

mysql -uroot -p

image.gif

修改设置密码的规则

set global validate_password_length=4;

image.gif

长度最低位数

set global validate_password_policy=LOW;

image.gif

修改密码

set password = password('123456');

image.gif

开启访问权限

grant all on *.* to 'root'@'%' identified by '123456';

image.gif

GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

刷新MySQL的系统权限相关表,否则会出现拒绝访问

flush privileges;

image.gif

启动Tomcat

关闭防火墙

systemctl stop firewalld

image.gif

启动tomcat

进入Tomcat的bin目录启动服务

cd /usr/local/apache-tomcat-7.0.57/
cd bin

image.gif

启动

sh startup.sh或者./startup.sh

image.gif

防火墙操作

查看防火墙状态

systemctl status firewalld / firewall-cmd --state

image.gif

暂时关闭防火墙

systemctl stop firewalld

image.gif

永久关闭防火墙(禁用开机自启)

==下次启动,才生效==

systemctl disable firewalld

image.gif

永久开启防火墙(启用开机自启)

==下次启动,才生效==

systemctl enable firewalld

image.gif

开放指定端口

==需要重新加载生效==

firewall-cmd --zone=public --add-port=8080/tcp --permanent

image.gif

关闭指定端口

==需要重新加载生效==

firewall-cmd --zone=public --remove-port=8080/tcp --permanent

image.gif

立即生效(重新加载)

firewall-cmd --reload

image.gif

查看开放端口

firewall-cmd --zone=public --list-ports

image.gif

杀死端口

查询某个进程占用端口

ps -ef |grep tomcat

image.gif

杀死占用进程的端口

kill -9 PID

image.gif


相关文章
|
4天前
|
人工智能 Unix Linux
【初识Linux】Linux环境配置、Linux的基本指令 一
【初识Linux】Linux环境配置、Linux的基本指令 一
|
14天前
|
算法 Unix Linux
【linux】详解linux基本指令
【linux】详解linux基本指令
|
14天前
|
监控 Java Linux
Linux下JVM相关指令详解及案例介绍
Linux下JVM相关指令详解及案例介绍
17 1
|
6天前
|
Linux 网络安全 Docker
【Linux】Linux常用指令合集精讲,一篇让你彻底掌握(万字真言)3
【Linux】Linux常用指令合集精讲,一篇让你彻底掌握(万字真言)
11 0
|
6天前
|
Linux 网络安全 开发工具
【Linux】Linux常用指令合集精讲,一篇让你彻底掌握(万字真言)2
【Linux】Linux常用指令合集精讲,一篇让你彻底掌握(万字真言)
12 0
|
6天前
|
Linux
【Linux】Linux常用指令合集精讲,一篇让你彻底掌握(万字真言)1
【Linux】Linux常用指令合集精讲,一篇让你彻底掌握(万字真言)
11 0
|
12天前
|
监控 网络协议 安全
Linux基本指令之网络通信命令
Linux基本指令之网络通信命令
|
12天前
|
Linux Shell Go
Linux中文件操作基本指令大全
Linux中文件操作基本指令大全
|
14天前
|
Unix Linux 索引
【linux】详解linux基本指令
【linux】详解linux基本指令
|
19天前
|
Linux
linux指令按端口查找和杀死进程
linux指令按端口查找和杀死进程
14 0