zoukankan      html  css  js  c++  java
  • debian7.2+nginx+mysql

    1、安装mysql 

    sudo aptitude install mysql-server

    netstat -atln 查看3306端口

    数据库目录: /var/lib/mysql/

    配置文件/usr/share/mysql/

    启动脚本文件 /etc/init.d/mysql

    1.1 查看mysql运行状态并登录

    ps -ef |grep mysqld

    如果有mysqld_safe和mysqld进程说明已启动。

    登录 /usr/bin/mysql -u username -h host -p password dbname

    退出 mysql>输入q或quit退出mysql

    1.2 查看mysql是否在开机启动列表中

    /sbin/chkconfig --list     查看开机自启动服务列表

    /sbin/chkconfig --add mysql 添加到开机启动服务列表中

    /sbin/chkconfig --del mysql 从开机启动服务列表中删除

    1.3 停止mysql

     mysqladmin -u root -p shutdown

    1.4 修改用户密码

    mysqladmin -u用户名 -p旧密码 password 新密码

    1.5 启动mysql

    sudo /usr/bin/mysqld_safe & 

    1.6 备份与恢复

    cd /val/lib/mysql/

    mysqldump -uroot -p --opt aaa>backup_aaa

    mysql -uroot -p aaa<backup_aaa

    2、安装nginx

    sudo aptitude install nginx

    2.1 启动nginx 

    cd /usr/sbin/

    sudo /nginx &

    2.2 查看nginx运行状态

    ps -ef | grep nginx

    root 4342 1 0 12:25 ? 00:00:00 nginx: master process ./nginx
    www-data 4343 4342 0 12:25 ? 00:00:00 nginx: worker process
    www-data 4344 4342 0 12:25 ? 00:00:00 nginx: worker process
    www-data 4345 4342 0 12:25 ? 00:00:00 nginx: worker process
    www-data 4346 4342 0 12:25 ? 00:00:00 nginx: worker process

    2.3 停止nginx

    sudo kill -QUIT 4342(master process id)

    3、安装django

    First, download Django-1.6.1.tar.gz. then:
    tar xzvf Django-1.6.1.tar.gz cd Django-1.6.1 sudo python setup.py install

    4、安装python-mysqldb

    apt-get install python-mysqldb

  • 相关阅读:
    LeetCode 842. Split Array into Fibonacci Sequence
    LeetCode 1087. Brace Expansion
    LeetCode 1219. Path with Maximum Gold
    LeetCode 1079. Letter Tile Possibilities
    LeetCode 1049. Last Stone Weight II
    LeetCode 1046. Last Stone Weight
    LeetCode 1139. Largest 1-Bordered Square
    LeetCode 764. Largest Plus Sign
    LeetCode 1105. Filling Bookcase Shelves
    LeetCode 1027. Longest Arithmetic Sequence
  • 原文地址:https://www.cnblogs.com/zxpo/p/3530856.html
Copyright © 2011-2022 走看看