防火墙添加端口,重启生效
#添加端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent
#重启
firewall-cmd --reload
解压文件
tar -xvf xxxx.tar #解压.tar文件
tar -zxvf xxx.tar.gz /test #解压.gz文件 到test文件夹内
tar -jxvf xxx.bz2
tar -Jxvf xxx.xz
压缩文件
tar -cvf xxx.tar /test/xx #打包
tar -zcvf xxx.tar.gz test/ #打包为.gz格式
tar -jcvf xx.tar.bz2 test/
tar -Jcvf xx.tar.xz test/
端口
lsof -i:80 #查看端口占用
kill -9 pid #杀掉这个进程
mysql相关操作
service mysql start #启动mysql服务
service mysql stop #停止mysql服务
service mysql restart #重启mysql服务
进入mysql->
create database 库名 (character utf8);#创建库
drop database 库名; #删除库
show databases; #显示库
use 库名; #使用库
source /home/data/xxx.sql;#运行.sql文件
set password for root@localhost = password('123456')#设置root用户密码
grant all privileges on *.* to '用户名'@'%' identified by '密码'#配置远程用户登录
select host,user,password_expired,password_last_changed,password_lifetime FROM mysql.user#查看mysql用户
drop user <用户名> #删除用户
后台运行Python
nohup python my.py &