linux 部署常用命令

1.service iptables restart  重启防火墙
2.ps -ef | grep tomcat/进程名称   查看进程
3.kill -9 进程号  杀掉进程
4.df -h 查看磁盘占用情况
5.lsb_release -a 查看系统版本号
6.vi /etc/sysconfig/iptables 修改防火墙端口号
7.systemctl restart iptables.service #重启防火墙使配置生效
8.systemctl enable iptables.service #设置防火墙开机启动
9.service mysqld restart mysql重启  
10.free -h  查看内存占用情况

mysql基本命令

 连接数据库执行命令: mysql -u 用户名 -p  
 重启mysql服务执行命令:  service mysql restart
 开启mysql服务执行命令:  service mysql start
 停止mysql服务执行命令:  service mysql stop
 查看mysql状态执行命令:  >>mysql

Linux下允许MySQL 授权远程连接
1、mysql -u root -p   (root)用户名
2、mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
3、mysql>flush privileges;
4、如果此时还无法连接,检测配置文件(/etc/mysql/mysql.conf.d/mysqld.cnf) bind-address配置是否开启,应该是关闭
#bind-address = 127.0.0.1 注释掉;
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1                    <----这个
#
# * Fine Tuning
#
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
5、重启mysql:/etc/init.d/mysql restart;

nginx

1.进入nginx可执行目录sbin下,输入命令./nginx -s reload 即可
2.查找当前nginx进程号,然后输入命令:kill -HUP 进程号 实现重启nginx服务

猜你喜欢

转载自blog.csdn.net/qq_38150538/article/details/88799354