linux上安装python服务器相关工具
1、升级系统
yum check-update
yum update
2、安装一些常用的工具
yum install ntp iptraf sysstat screen subversion wget bzip2 nfs-utils vim-common
3、设置每天自动核准时间
# crontab -e
0 * * * * /usr/sbin/ntpdate 210.72.145.44
:wq
4、安装一些开发包
# yum install make gcc gcc-c++ libjpeg-devel libpng-devel zlib-devel tcl-devel freetype-devel libevent-devel openssl-devel db4-devel curl-devel pcre-devel ncurses-devel readline-devel sqlite-devel bzip2-devel
5、安装sqlite
wget http://www.sqlite.org/sqlite-3.6.4.tar.gz
tar xzvf sqlite-3.6.4.tar.gz
cd sqlite-3.6.4
./configure --enable-threadsafe
make
make install
5、安装Python
wget http://www.python.org/ftp/python/2.5.4/Python-2.5.4.tar.bz2
tar xjvf Python-2.5.4.tar.bz2
cd Python-2.5.4/
./configure --enable-unicode=ucs4
make
make install
6、安装MySQL 5.0
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.83.tar.gz/from/http://mysql.mirrors.pair.com/
tar xzvf mysql-5.0.83.tar.gz
cd mysql-5.0.83/
groupadd mysql
useradd -g mysql mysql
mkdir /opt/mysql-data
CFLAGS="-O3 -march=nocona" CXX=gcc CXXFLAGS="-O3 -march=nocona -felide-constructors \
-fno-exceptions -fno-rtti" ./configure \
--prefix=/usr/local/mysql --enable-assembler \
--with-charset=utf8 \
--with-extra-charsets=gbk,gb2312,latin1 \
--localstatedir=/opt/mysql-data \
--with-mysqld-user=mysql --enable-large-files --with-big-tables \
--without-debug \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--enable-thread-safe-client \
 
相关文档:
准备工作:
用到的perl 扩展组件(modules)在上篇贴出.( win32::odbc 模块
)下载组件后按照Readme文件安装倒响应目录.配置好相应的odbc数据源.
程序实现:
使用
use
Win32::ODBC;
语句包含应使用的模块是win32::odbc,写出数据库
连接字符串
$DSN = "DSN =
My DSN ......
import sys
import os
import datetime
import time
class ArgsDealwith:
def arg_environment(self, args):
filepath = ('PYTHON_PATH', 'path')
for i in filepath:
&nbs ......
最近实验室内部的mysql的root密码被修改了,需要想办法修改新密码。方法如下:
1, 关闭mysql服务
/etc/init.d/mysqld stop
2,使用–skip-grant-tables选项启动MySQL服务,可以修改/etc/inin.d/mysqld脚本启动位置增加此选项,
vi /etc/init.d/mysqld
在下面运行启动的语句里增加--skip-grant-tables
......
1.简单的将日志打印到屏幕
import
logging
logging.
debug(
'This is debug message'
)
logging.
info(
'This is info message'
)
logging.
warning(
'This is warning message'
)
屏幕上打印:
WARNING:root:This is warning ......