Linux常用指令

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
云数据库 RDS MySQL Serverless,价值2615元额度,1个月
简介: 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


相关文章
|
17天前
|
Unix Linux Windows
Linux的学习之路:3、基础指令(2)
Linux的学习之路:3、基础指令(2)
32 0
|
10天前
|
Linux
【Linux系统编程】基础指令(二)(下)
【Linux系统编程】基础指令(二)
|
10天前
|
Linux C语言
【Linux系统编程】基础指令(二)(上)
【Linux系统编程】基础指令(二)
|
1天前
|
人工智能 数据可视化 Unix
【Linux】Linux系统基础指令 ( 1 )
本文讲解的指令是基础的操作,下一篇文章我们将继续讲解不同指令。
6 0
|
1天前
|
存储 Unix Linux
【Linux修行路】基本指令(二)
【Linux修行路】基本指令(二)
|
1天前
|
存储 人工智能 安全
【Linux修行路】基本指令(一)
【Linux修行路】基本指令(一)
|
3天前
|
Linux 网络安全 开发工具
Linux常见指令
Linux指令涵盖9大类:文件管理(如ls, cp, mv, rm)、文本处理(cat, grep, sed, awk)、系统管理(top, ps, kill, df, free)、网络管理(ping, ifconfig, ssh, scp)、权限用户管理(chmod, chown, useradd, passwd)、软件管理(apt, yum, pacman)、编程开发(gcc, git, make)、帮助信息(man, info, whatis)。这些指令用于系统操作、网络诊断、软件安装及用户管理等任务。
|
3天前
|
Unix Linux
【Linux】基本指令
【Linux】基本指令
12 1
|
3天前
|
人工智能 Linux 网络安全
【Linux】安装+基本指令
【Linux】安装+基本指令
10 2
【Linux】安装+基本指令
|
8天前
|
Shell Linux C++
【Linux】关于环境变量——你需要知道这些原理&指令
【Linux】关于环境变量——你需要知道这些原理&指令