由于以前帮朋友买过阿里云服务器,一直以为,不能再体验新用户免费了,由于最近比较有心情研究python,linux,就报着侥幸的心理,重新注册一个帐号试一下,注册完之后,惊奇的发现,原来阿里只要是新注册的帐户就可以免费申请半年的ces,不验证身份信息,同一个实名认证下不同的帐号,也可以免费申请,开了1M带宽,并顺手申请了免费的数据库,yeah….开始真正的服务器学习之旅了.
centos6.5下默认的python 是2.6.6 本来想升级到2.7的, bing了一下,发现升级后有系统默认的很多东西要重新配,比如yum ,所以做罢,2.6就2.6吧.
下面是安装 pip和pyMySQL过程
[root@iZ28w7cidk2Z ~]#yum install python-pipLoaded plugins: security
Setting up InstallPRocess
Resolving Dependencies-->Running transaction check---> Package python-pip.noarch 0:1.3.1-4.el6 will be installed-->Finished Dependency Resolution
Dependencies Resolved================================================================================Package Arch Version Repository Size================================================================================Installing:
python-pip noarch 1.3.1-4.el6 epel 330k
Transaction Summary================================================================================Install1Package(s)
Total download size:330k
Installed size:1.0M
Is this ok [y/N]: y
Downloading Packages:
python-pip-1.3.1-4.el6.noarch.rpm | 330 kB 00:00Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : python-pip-1.3.1-4.el6.noarch 1/1Verifying : python-pip-1.3.1-4.el6.noarch 1/1Installed:
python-pip.noarch 0:1.3.1-4.el6
Complete!
[root@iZ28w7cidk2Z~]#pip install pymysqlDownloading/unpacking pymysql
Downloading PyMySQL-0.6.3.tar.gz (53kB): 53kB downloaded
Running setup.py egg_infoforpackage pymysql
Installing collected packages: pymysql
Running setup.py installforpymysql
Successfully installed pymysql
Cleaning up...
[root@iZ28w7cidk2Z~]#pythonPython 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type"help","copyright","credits"or"license"formore information.>>>importpymysql>>>
其实 就两句:
#yum install python-pip
#pip install pymysql