常用服务启动脚本

常用服务脚本命令

  1. mysql

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    // login mysql
    mysql -u root -p

    // start mysql server
    mysql.server start

    // stop mysql server
    mysql.server stop

    // restart mysql server
    mysql.server restart

    // reload mysql server
    mysql.server reload
  2. nginx

    1
    2
    3
    4
    5
    6
    7
    8
    9
    // config nginx
    sudo vim /usr/local/etc/nginx/nginx.conf

    // start nginx server
    cd /usr/local/bin
    sudo ./nginx

    // reload nginx server
    sudo /usr/local/bin/nginx -s reload
  3. redis

    1
    2
    3
    4
    5
    6
    // login redis
    redis-cli

    // start redis server
    cd /usr/local/etc
    redis-server redis.conf
  4. vagrant

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    // login vagrant
    cd ~/projects/vip/vagrant
    vagrant ssh

    // start vagrant server
    cd /Users/huiqiang.lin/projects/vip/vagrant
    vagrant up

    // reload vagrant server
    cd /Users/huiqiang.lin/projects/vip/vagrant
    vagrant reload
  5. ssh远程登录

    1
    ssh -p port username@ip