1、环境目录结构
[root@localhost python_dir]# pwd
/root/python_dir
[root@localhost python_dir]# ls -lGR
.:
total 5148
-rw-r--r--. 1 root 604 Dec 17 11:24 db.py
-rw-r--r--. 1 root 886 Dec 17 11:54 db.pyc
-rw-r--r--. 1 root 137 Dec 18 03:26 dirfilefilter_print.py
-rwxr-xr-x. 1 root 1123 Dec 18 06:54 json2mysql_python_arrayastext.py
-rwxr-xr-x. 1 root 925 Dec 18 03:39 json2mysql_python_dirfilefilter.py
-rwxrwxrwx. 1 root 939 Dec 18 02:21 json2mysql_python_recordasarray.py
-rw-r--r--. 1 root 2100077 Dec 18 01:54 json_array.json
-rw-r--r--. 1 root 1998167 Dec 18 02:01 json_array.txt
-rw-r--r--. 1 root 5150 Dec 18 06:05 test1.txt
-rw-r--r--. 1 root 7708 Dec 18 02:39 test2.txt
-rw-r--r--. 1 root 7708 Dec 17 11:11 test3.txt
-rw-r--r--. 1 root 1120389 Dec 17 13:22 test_big.json
2、MySQL-python的安装
安装过程:
[root@Master ~]# yum install MySQL-python
Loaded plugins: refresh-packagekit, security
base | 3.7 kB 00:00
epel | 4.3 kB 00:00
epel/primary_db | 5.7 MB 00:05
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 3.2 MB 00:03
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package MySQL-python.x86_64 0:1.2.3-0.3.c1.1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================================================
Installing:
MySQL-python x86_64 1.2.3-0.3.c1.1.el6 base 86 k
Transaction Summary
==============================================================================================================================================================================================================================================================================
Install 1 Package(s)
Total download size: 86 k
Installed size: 246 k
Is this ok [y/N]: y
Downloading Packages:
MySQL-python-1.2.3-0.3.c1.1.el6.x86_64.rpm | 86 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : MySQL-python-1.2.3-0.3.c1.1.el6.x86_64 1/1
Unable to connect to dbus
Verifying : MySQL-python-1.2.3-0.3.c1.1.el6.x86_64