• 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

  • 相关阅读:
    c++入门之初话结构体
    c++学习之字符串拼接
    数组赋值问题
    c++之sizeof的用法
    MySQL 创建一个简单的成绩管理系统
    KMP算法详解
    [Leetcode] Implement strstr
    [Leetcode] Multiply strings 字符串对应数字相乘
    [Leetcode] count and say 计数和说
    [Leetcode] Roman to integer 罗马数字转成整数
  • 原文地址:https://www.cnblogs.com/zxpo/p/3530856.html
Copyright © 2020-2023  润新知