zoukankan      html  css  js  c++  java
  • Flask+Mysql搭建网站之安装Mysql

    安装Mysql

    # sudo apt-get install mysql-server

    安装过程需要输入root密码,这个密码是mysql 的root密码,之后连接mysql会用到,这个要记住。

    安装完成之后,可以使用如下命令check是否安装成功。

    #mysql --user=root -p

    输入mysql 的root密码。如果可以登录成功,说明安装完成。

    安装 python-mysqldb

    #sudo apt-get install python-mysqldb

    这一步我遇到3个问题:

    问题一:Could not find any downloads that satisfy the requirement MySQL-python

    解决方法:

    http://pypi.v2ex.com/simple/mysql-python/ 手动下载 MySQL-python-1.2.5.zip 。解压之后copy到Linux 路径。

    然后再执行使用如下命令安装。

    # flask/bin/pip install MySQL-python-1.2.5/

    问题二:EnvironmentError: mysql_config not found

    解决方法:

    # sudo apt-get install libmysqlclient-dev

    # vim MySQL-python-1.2.5/setup_posix.py,更改 mysql_config.path值。

     mysql_config.path = "/usr/bin/mysql_config"

    问题三:_mysql.c:29:20: fatal error: Python.h: No such file or directory

    解决方法:

    # sudo apt-get install python-dev

  • 相关阅读:
    git merge
    google platform
    http tutorial
    DS,AA tree
    Java,Hashtable
    java,Object
    Pumping lemma for regular languages
    Pumping lemma
    Context-free grammar
    Formal language
  • 原文地址:https://www.cnblogs.com/miniren/p/4831324.html
Copyright © 2011-2022 走看看