linux 操作命令

4netstat -anp|grep mysqld  //查看mysql 占用端口
    
    netstat -ant | grep 9312   //查看端口号是否启用
    lsof -i :9312
    ps -ef | grep searchd
    service iptables status

    ps -ef | less 



==mysql的管理==================================================================================================
    mysql -u root -p mysql    //连接数据库服务器的命令
    select user();            //mysql 查看所有用户的语句
    netstat -anp|grep mysqld  //查看mysql 占用端口
    
    netstat -ant | grep 9312   //查看端口号是否启用
    lsof -i :9312
    ps -ef | grep searchd
    service iptables status
    ps -ef | less    
    
    
    /etc/init.d/mysqld restart #重启MySql
    /etc/init.d/httpd restart  #重启Apche
    /etc/mysql/my.cnf          #mysql配置文件

    操作mysql mysql> show databases;   show tables;
    设置mysql密码:
        格式:    GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH  GRANT OPTION;
        mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by ‘123′;
        # 给来自10.163.225.87的用户joe分配可对数据库vtdc的employee表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。
        mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
        # 给来自10.163.225.87的用户joe分配可对数据库vtdc所有表进行所有操作的权限,并设定口令为123。
        mysql>grant all privileges on *.* to joe@10.163.225.87 identified by ‘123′;
        # 给来自10.163.225.87的用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
        mysql>grant all privileges on *.* to joe@localhost identified by ‘123′;
        # 给本机用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。        
    刷新MySQL的系统权限相关表:  FLUSH PRIVILEGES;
==查看IP地址 ===============================================================================================      
    ifconfig eth0
==开机启动===================================================================================================
   1)察看mysql是否在自动启动列表中
   [root@test1 local]# /sbin/chkconfig --list
   2)把MySQL添加到你系统的启动服务组里面去
   [root@test1 local]# /sbin/chkconfig –- add mysql
   3)把MySQL从启动服务组里面删除。
   [root@test1 local]# /sbin/chkconfig –-del mysql
==防火墙======================================================================================================= =
    配置防火墙   vi /etc/sysconfig/iptables
    最后重启防火墙使配置生效   /etc/init.d/iptables restart
    关闭防火墙  service iptables stop
==定时器======================================================================================================
crontab    /etc/crontab
   设置定时调用
       */5 9-23 * * * root /usr/bin/curl http://www.cbrs.com/index.php?r=CarrentalApi/LogManager/SendEmail
   crontab的日志记录       tail -f /var/log/cron       
   服务操作说明:
        /sbin/service crond start //启动服务
        /sbin/service crond stop //关闭服务
        /sbin/service crond restart //重启服务
        /sbin/service crond reload //重新载入配置
==redis==============================================================================================================       
    重启redis   /etc/init.d/redis restart
    配置redis.config   /etc/redis.conf
==系统操作=============================================================================================================
    重启命令:
    1、reboot
    2、shutdown -r now 立刻重启(root用户使用)
    3、shutdown -r 10 过10分钟自动重启(root用户使用)
    4、shutdown -r 20:35 在时间为20:35时候重启(root用户使用)

    关机命令:
    1、halt   立刻关机
    2、poweroff  立刻关机
    3、shutdown -h now 立刻关机(root用户使用)
    4、shutdown -h 10 10分钟后自动关机
=====================================================================================================================
host: /etc/hosts

=============================
test-brs:
sudo ./install_php index.php
======================================
1查找最近发生变化的php文件    find . -type f -name '*.php' -mtime -7

2查找文件中是否存在疑似代码    find . -type f -name '*.php' | xargs grep -l "eval *(" --color
(   find . -type f -name '*.php' | xargs grep -l "base64_decode *(" --color
    find . -type f -name '*.php' | xargs grep -l "gzinflate *(" --color
    find . -type f -name '*.php' | xargs grep -l "eval *(str_rot13 *(base64_decode *(" --color
)
3比较代码文件  diff -r wordpress-clean/ wordpress-compromised/ -x wp-content

4  extundelete实现Linux下文件/文件夹数据恢复!



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值