-----------------------------------python-----------------------------------
tar -zvxf Python-2.5.2.tgz
cd Python-2.5.2
./configure --prefix=/home/songyang/django-suite/python --enable-shared
make
make install
vi .bash_profile
PATH=$HOME/django-suite/python/binPATHHOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/cpro/django-suite/python/lib
source .bash_profile
-----------------------------------mysql-----------------------------------
tar -zvxf mysql-5.0.51b.tar.gz
cd mysql-5.0.51b
./configure --prefix=$HOME/django-suite/mysql/mysql_6606 --with-charset=gb2312 --enable-local-infile --with-unix-socket-path=$HOME/django-suite/mysql/mysql_6606/mysql.sock --with-tcp-port=6606 --with-mysqld-user=songyang
make
make install
cd ~/django_tools/mysql-5.0.51b/support-files
cp my-medium.cnf ~/django-suite/mysql/mysql_6606/my.cnf
注意my.cnf中的路径
[client]
socket = /home/songyang/django-suite/mysql/mysql_6606/mysql.sock
[mysqld]
socket = /home/songyang/django-suite/mysql/mysql_6606/mysql.sock
其中跟songyang有关的部分在迁移时需要注意迁移后修改为正确的路径
./bin/mysql_install_db --user=root
bin/mysqld_safe --user=root &
bin/mysqladmin -u root password '123456'
设置.bash_profile
PATH=$HOME/django-suite/python/binHOME/django-suite/mysql/mysql_6606/binPATHHOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATHHOME/django-suite/python/libHOME/django-suite/mysql/mysql_6606/lib/mysql
---------------------------------mysql-python-----------------------------------------------
tar -zvxf ./MySQL-python-1.2.2.tar.gz
cp -r MySQL-python-1.2.2 ~/django-suite/python
vi site.cfg
threadsafe = False
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0
grep 'usr/' *
dbapi20.py
setup.py
test_capabilities.py
test_MySQLdb_capabilities.py
test_MySQLdb_dbapi20.py
把这些文件中的#!/usr/bin/env python去掉
python setup.py build
python setup.py install
cd django-suite/python/lib/
ln -s ~/django-suite/mysql/mysql_6606/lib/mysql/libmysqlclient.so.15.0.0 libmysqlclient.so.15
ln -s ~/django-suite/mysql/mysql_6606/lib/mysql/libmysqlclient.so.15.0.0 libmysqlclient.so
ln -s ~/django-suite/mysql/mysql_6606/lib/mysql/libmysqlclient.so.15.0.0 libmysqlclient.so.15.0.0
--------------------------------Django---------------------------------------------
tar -zvxf Django-0.96.3
cd Django-0.96.3
python setup.py install
cd ~/django-suite/python/lib/python2.5/site-packages/django/conf
vi global_settings.py
修改为TIME_ZONE = 'CCF'
LANGUAGE_CODE = 'zh-cn'
DEFAULT_CHARSET = 'gb2312'
SERVER_EMAIL = 'songyang@baidu.com'
cd ~/dango-suite/python/lib/python2.5/site-packages/django/db/backends/mysql/
在base.py中
搜索 kwargs.update(self.options)
self.connection = Database.connect(**kwargs)
cursor = self.connection.cursor()
添加 if self.connection.get_server_info() >= '4.1':
cursor.execute("SET NAMES 'GB2312';")
当让也可以使用我修改后的django进行安装,直接python setup.py install就可以了