在python的API上面,看到了MySQLdb,即python可以操作mysql数据库

接下来,我就把我这两天的工作给大伙絮叨絮叨:

准备条件:

1.MySQL-python-1.2.4b4.win32-py2.7.exe 安装包  注:只支持python2.4-2.7版本,所以下面选择的是python2.7.5版本

2.python-2.7.5.msi 安装包

3.mysql-essential-5.5.5-m3-win32.msi 安装包

4.如果你都安装成功了,你不妨去验证一下:python开发_python操作mysql数据库

步骤:

安装mysql数据库

嘿嘿,安装mysql数据的操作,我就不向大家展示了

下面提供mysql的一些操作:mysql_语法总结

安装python-2.7.5.msi

首先我们到官网:http://www.python.org

下载:python-2.7.5.msi 安装包

下载后,点击直接安装了

我安装的目录是:E:\python2.7.5

把该路径设置到系统环境变量中。

安装MySQL-python-1.2.4b4.win32-py2.7.exe

下载:MySQL-python-1.2.4b4.win32-py2.7.exe的时候,

明确说明了,对python的支持是2.4-2.7,所以我选择的是2.7.5的python版本。

安装的目录:E:\python2.7.5\Lib\site-packages

安装完成后,会在目录:E:\python2.7.5\Lib\site-packages下面多出一些文件

在GUI中输入:

>>>help()

....

help>MySQLdb

出现的信息:

Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> help() Welcome to Python 2.7! This is the online help utility. If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/2.7/tutorial/. Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit". To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam". help> MySQLdb
Help on package MySQLdb: NAME
MySQLdb - MySQLdb - A DB API v2.0 compatible interface to MySQL. FILE
e:\python2.7.5\lib\site-packages\mysqldb\__init__.py DESCRIPTION
This package is a wrapper around _mysql, which mostly implements the
MySQL C API. connect() -- connects to server See the C API specification and the MySQL documentation for more info
on other items. For information on how MySQLdb handles type conversion, see the
MySQLdb.converters module. PACKAGE CONTENTS
connections
constants (package)
converters
cursors
release
times SUBMODULES
FIELD_TYPE CLASSES
__builtin__.frozenset(__builtin__.object)
DBAPISet
__builtin__.object
datetime.date
datetime.datetime
datetime.time
exceptions.StandardError(exceptions.Exception)
_mysql_exceptions.MySQLError
_mysql_exceptions.Error
_mysql_exceptions.DatabaseError
_mysql_exceptions.DataError
_mysql_exceptions.IntegrityError
_mysql_exceptions.InternalError
_mysql_exceptions.NotSupportedError
_mysql_exceptions.OperationalError
_mysql_exceptions.ProgrammingError
_mysql_exceptions.InterfaceError
_mysql_exceptions.Warning(exceptions.Warning, _mysql_exceptions.MySQLError)
exceptions.Warning(exceptions.Exception)
_mysql_exceptions.Warning(exceptions.Warning, _mysql_exceptions.MySQLError) class DBAPISet(__builtin__.frozenset)
| A special type of set for which A == x is true if A is a
| DBAPISet and x is a member of that set.
|
| Method resolution order:
| DBAPISet
| __builtin__.frozenset
| __builtin__.object
|
| Methods defined here:
|
| __eq__(self, other)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from __builtin__.frozenset:
|
| __and__(...)
| x.__and__(y) <==> x&y
|
| __cmp__(...)
| x.__cmp__(y) <==> cmp(x,y)
|
| __contains__(...)
| x.__contains__(y) <==> y in x.
|
| __ge__(...)
| x.__ge__(y) <==> x>=y
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __gt__(...)
| x.__gt__(y) <==> x>y
|
| __hash__(...)
| x.__hash__() <==> hash(x)
|
| __iter__(...)
| x.__iter__() <==> iter(x)
|
| __le__(...)
| x.__le__(y) <==> x<=y
|
| __len__(...)
| x.__len__() <==> len(x)
|
| __lt__(...)
| x.__lt__(y) <==> x<y
|
| __ne__(...)
| x.__ne__(y) <==> x!=y
|
| __or__(...)
| x.__or__(y) <==> x|y
|
| __rand__(...)
| x.__rand__(y) <==> y&x
|
| __reduce__(...)
| Return state information for pickling.
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __ror__(...)
| x.__ror__(y) <==> y|x
|
| __rsub__(...)
| x.__rsub__(y) <==> y-x
|
| __rxor__(...)
| x.__rxor__(y) <==> y^x
|
| __sizeof__(...)
| S.__sizeof__() -> size of S in memory, in bytes
|
| __sub__(...)
| x.__sub__(y) <==> x-y
|
| __xor__(...)
| x.__xor__(y) <==> x^y
|
| copy(...)
| Return a shallow copy of a set.
|
| difference(...)
| Return the difference of two or more sets as a new set.
|
| (i.e. all elements that are in this set but not the others.)
|
| intersection(...)
| Return the intersection of two or more sets as a new set.
|
| (i.e. elements that are common to all of the sets.)
|
| isdisjoint(...)
| Return True if two sets have a null intersection.
|
| issubset(...)
| Report whether another set contains this set.
|
| issuperset(...)
| Report whether this set contains another set.
|
| symmetric_difference(...)
| Return the symmetric difference of two sets as a new set.
|
| (i.e. all elements that are in exactly one of the sets.)
|
| union(...)
| Return the union of sets as a new set.
|
| (i.e. all elements that are in either set.)
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from __builtin__.frozenset:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T class DataError(DatabaseError)
| Exception raised for errors that are due to problems with the
| processed data like division by zero, numeric value out of range,
| etc.
|
| Method resolution order:
| DataError
| DatabaseError
| Error
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors inherited from MySQLError:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message class DatabaseError(Error)
| Exception raised for errors that are related to the
| database.
|
| Method resolution order:
| DatabaseError
| Error
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors inherited from MySQLError:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message Date = class date(__builtin__.object)
| date(year, month, day) --> date object
|
| Methods defined here:
|
| __add__(...)
| x.__add__(y) <==> x+y
|
| __eq__(...)
| x.__eq__(y) <==> x==y
|
| __format__(...)
| Formats self with strftime.
|
| __ge__(...)
| x.__ge__(y) <==> x>=y
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __gt__(...)
| x.__gt__(y) <==> x>y
|
| __hash__(...)
| x.__hash__() <==> hash(x)
|
| __le__(...)
| x.__le__(y) <==> x<=y
|
| __lt__(...)
| x.__lt__(y) <==> x<y
|
| __ne__(...)
| x.__ne__(y) <==> x!=y
|
| __radd__(...)
| x.__radd__(y) <==> y+x
|
| __reduce__(...)
| __reduce__() -> (cls, state)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __rsub__(...)
| x.__rsub__(y) <==> y-x
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __sub__(...)
| x.__sub__(y) <==> x-y
|
| ctime(...)
| Return ctime() style string.
|
| fromordinal(...)
| int -> date corresponding to a proleptic Gregorian ordinal.
|
| fromtimestamp(...)
| timestamp -> local date from a POSIX timestamp (like time.time()).
|
| isocalendar(...)
| Return a 3-tuple containing ISO year, week number, and weekday.
|
| isoformat(...)
| Return string in ISO 8601 format, YYYY-MM-DD.
|
| isoweekday(...)
| Return the day of the week represented by the date.
| Monday == 1 ... Sunday == 7
|
| replace(...)
| Return date with new specified fields.
|
| strftime(...)
| format -> strftime() style string.
|
| timetuple(...)
| Return time tuple, compatible with time.localtime().
|
| today(...)
| Current date or datetime: same as self.__class__.fromtimestamp(time.time()).
|
| toordinal(...)
| Return proleptic Gregorian ordinal. January 1 of year 1 is day 1.
|
| weekday(...)
| Return the day of the week represented by the date.
| Monday == 0 ... Sunday == 6
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| day
|
| month
|
| year
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| max = datetime.date(9999, 12, 31)
|
| min = datetime.date(1, 1, 1)
|
| resolution = datetime.timedelta(1) class Error(MySQLError)
| Exception that is the base class of all other error exceptions
| (not Warning).
|
| Method resolution order:
| Error
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors inherited from MySQLError:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message class IntegrityError(DatabaseError)
| Exception raised when the relational integrity of the database
| is affected, e.g. a foreign key check fails, duplicate key,
| etc.
|
| Method resolution order:
| IntegrityError
| DatabaseError
| Error
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors inherited from MySQLError:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message class InterfaceError(Error)
| Exception raised for errors that are related to the database
| interface rather than the database itself.
|
| Method resolution order:
| InterfaceError
| Error
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors inherited from MySQLError:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message class InternalError(DatabaseError)
| Exception raised when the database encounters an internal
| error, e.g. the cursor is not valid anymore, the transaction is
| out of sync, etc.
|
| Method resolution order:
| InternalError
| DatabaseError
| Error
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors inherited from MySQLError:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message class MySQLError(exceptions.StandardError)
| Exception related to operation with MySQL.
|
| Method resolution order:
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message class NotSupportedError(DatabaseError)
| Exception raised in case a method or database API was used
| which is not supported by the database, e.g. requesting a
| .rollback() on a connection that does not support transaction or
| has transactions turned off.
|
| Method resolution order:
| NotSupportedError
| DatabaseError
| Error
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors inherited from MySQLError:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message class OperationalError(DatabaseError)
| Exception raised for errors that are related to the database's
| operation and not necessarily under the control of the programmer,
| e.g. an unexpected disconnect occurs, the data source name is not
| found, a transaction could not be processed, a memory allocation
| error occurred during processing, etc.
|
| Method resolution order:
| OperationalError
| DatabaseError
| Error
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors inherited from MySQLError:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message class ProgrammingError(DatabaseError)
| Exception raised for programming errors, e.g. table not found
| or already exists, syntax error in the SQL statement, wrong number
| of parameters specified, etc.
|
| Method resolution order:
| ProgrammingError
| DatabaseError
| Error
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors inherited from MySQLError:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.StandardError:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.StandardError:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message Time = class time(__builtin__.object)
| time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object
|
| All arguments are optional. tzinfo may be None, or an instance of
| a tzinfo subclass. The remaining arguments may be ints or longs.
|
| Methods defined here:
|
| __eq__(...)
| x.__eq__(y) <==> x==y
|
| __format__(...)
| Formats self with strftime.
|
| __ge__(...)
| x.__ge__(y) <==> x>=y
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __gt__(...)
| x.__gt__(y) <==> x>y
|
| __hash__(...)
| x.__hash__() <==> hash(x)
|
| __le__(...)
| x.__le__(y) <==> x<=y
|
| __lt__(...)
| x.__lt__(y) <==> x<y
|
| __ne__(...)
| x.__ne__(y) <==> x!=y
|
| __nonzero__(...)
| x.__nonzero__() <==> x != 0
|
| __reduce__(...)
| __reduce__() -> (cls, state)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| dst(...)
| Return self.tzinfo.dst(self).
|
| isoformat(...)
| Return string in ISO 8601 format, HH:MM:SS[.mmmmmm][+HH:MM].
|
| replace(...)
| Return time with new specified fields.
|
| strftime(...)
| format -> strftime() style string.
|
| tzname(...)
| Return self.tzinfo.tzname(self).
|
| utcoffset(...)
| Return self.tzinfo.utcoffset(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| hour
|
| microsecond
|
| minute
|
| second
|
| tzinfo
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| max = datetime.time(23, 59, 59, 999999)
|
| min = datetime.time(0, 0)
|
| resolution = datetime.timedelta(0, 0, 1) Timestamp = class datetime(date)
| datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])
|
| The year, month and day arguments are required. tzinfo may be None, or an
| instance of a tzinfo subclass. The remaining arguments may be ints or longs.
|
| Method resolution order:
| datetime
| date
| __builtin__.object
|
| Methods defined here:
|
| __add__(...)
| x.__add__(y) <==> x+y
|
| __eq__(...)
| x.__eq__(y) <==> x==y
|
| __ge__(...)
| x.__ge__(y) <==> x>=y
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __gt__(...)
| x.__gt__(y) <==> x>y
|
| __hash__(...)
| x.__hash__() <==> hash(x)
|
| __le__(...)
| x.__le__(y) <==> x<=y
|
| __lt__(...)
| x.__lt__(y) <==> x<y
|
| __ne__(...)
| x.__ne__(y) <==> x!=y
|
| __radd__(...)
| x.__radd__(y) <==> y+x
|
| __reduce__(...)
| __reduce__() -> (cls, state)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __rsub__(...)
| x.__rsub__(y) <==> y-x
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __sub__(...)
| x.__sub__(y) <==> x-y
|
| astimezone(...)
| tz -> convert to local time in new timezone tz
|
| combine(...)
| date, time -> datetime with same date and time fields
|
| ctime(...)
| Return ctime() style string.
|
| date(...)
| Return date object with same year, month and day.
|
| dst(...)
| Return self.tzinfo.dst(self).
|
| fromtimestamp(...)
| timestamp[, tz] -> tz's local time from POSIX timestamp.
|
| isoformat(...)
| [sep] -> string in ISO 8601 format, YYYY-MM-DDTHH:MM:SS[.mmmmmm][+HH:MM].
|
| sep is used to separate the year from the time, and defaults to 'T'.
|
| now(...)
| [tz] -> new datetime with tz's local day and time.
|
| replace(...)
| Return datetime with new specified fields.
|
| strptime(...)
| string, format -> new datetime parsed from a string (like time.strptime()).
|
| time(...)
| Return time object with same time but with tzinfo=None.
|
| timetuple(...)
| Return time tuple, compatible with time.localtime().
|
| timetz(...)
| Return time object with same time and tzinfo.
|
| tzname(...)
| Return self.tzinfo.tzname(self).
|
| utcfromtimestamp(...)
| timestamp -> UTC datetime from a POSIX timestamp (like time.time()).
|
| utcnow(...)
| Return a new datetime representing UTC day and time.
|
| utcoffset(...)
| Return self.tzinfo.utcoffset(self).
|
| utctimetuple(...)
| Return UTC time tuple, compatible with time.localtime().
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| hour
|
| microsecond
|
| minute
|
| second
|
| tzinfo
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)
|
| min = datetime.datetime(1, 1, 1, 0, 0)
|
| resolution = datetime.timedelta(0, 0, 1)
|
| ----------------------------------------------------------------------
| Methods inherited from date:
|
| __format__(...)
| Formats self with strftime.
|
| fromordinal(...)
| int -> date corresponding to a proleptic Gregorian ordinal.
|
| isocalendar(...)
| Return a 3-tuple containing ISO year, week number, and weekday.
|
| isoweekday(...)
| Return the day of the week represented by the date.
| Monday == 1 ... Sunday == 7
|
| strftime(...)
| format -> strftime() style string.
|
| today(...)
| Current date or datetime: same as self.__class__.fromtimestamp(time.time()).
|
| toordinal(...)
| Return proleptic Gregorian ordinal. January 1 of year 1 is day 1.
|
| weekday(...)
| Return the day of the week represented by the date.
| Monday == 0 ... Sunday == 6
|
| ----------------------------------------------------------------------
| Data descriptors inherited from date:
|
| day
|
| month
|
| year class Warning(exceptions.Warning, MySQLError)
| Exception raised for important warnings like data truncations
| while inserting, etc.
|
| Method resolution order:
| Warning
| exceptions.Warning
| MySQLError
| exceptions.StandardError
| exceptions.Exception
| exceptions.BaseException
| __builtin__.object
|
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.Warning:
|
| __init__(...)
| x.__init__(...) initializes x; see help(type(x)) for signature
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from exceptions.Warning:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| ----------------------------------------------------------------------
| Methods inherited from exceptions.BaseException:
|
| __delattr__(...)
| x.__delattr__('name') <==> del x.name
|
| __getattribute__(...)
| x.__getattribute__('name') <==> x.name
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
| __getslice__(...)
| x.__getslice__(i, j) <==> x[i:j]
|
| Use of negative indices is not supported.
|
| __reduce__(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| __setattr__(...)
| x.__setattr__('name', value) <==> x.name = value
|
| __setstate__(...)
|
| __str__(...)
| x.__str__() <==> str(x)
|
| __unicode__(...)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from exceptions.BaseException:
|
| __dict__
|
| args
|
| message FUNCTIONS
Binary(x) Connect(*args, **kwargs)
Factory function for connections.Connection. Connection = Connect(*args, **kwargs)
Factory function for connections.Connection. DateFromTicks(ticks)
Convert UNIX ticks into a date instance. TimeFromTicks(ticks)
Convert UNIX ticks into a time instance. TimestampFromTicks(ticks)
Convert UNIX ticks into a datetime instance. connect = Connect(*args, **kwargs)
Factory function for connections.Connection. debug(...)
Does a DBUG_PUSH with the given string.
mysql_debug() uses the Fred Fish debug library.
To use this function, you must compile the client library to
support debugging. escape(...)
escape(obj, dict) -- escape any special characters in object obj
using mapping dict to provide quoting functions for each type.
Returns a SQL literal string. escape_dict(...)
escape_sequence(d, dict) -- escape any special characters in
dictionary d using mapping dict to provide quoting functions for each type.
Returns a dictionary of escaped items. escape_sequence(...)
escape_sequence(seq, dict) -- escape any special characters in sequence
seq using mapping dict to provide quoting functions for each type.
Returns a tuple of escaped items. escape_string(...)
escape_string(s) -- quote any SQL-interpreted characters in string s. Use connection.escape_string(s), if you use it at all.
_mysql.escape_string(s) cannot handle character sets. You are
probably better off using connection.escape(o) instead, since
it will escape entire sequences as well as strings. get_client_info(...)
get_client_info() -- Returns a string that represents
the client library version. string_literal(...)
string_literal(obj) -- converts object obj into a SQL string literal.
This means, any special SQL characters are escaped, and it is enclosed
within single quotes. In other words, it performs: "'%s'" % escape_string(str(obj)) Use connection.string_literal(obj), if you use it at all.
_mysql.string_literal(obj) cannot handle character sets. DATA
BINARY = DBAPISet([249, 250, 251, 252])
DATE = DBAPISet([10, 14])
NULL = 'NULL'
NUMBER = DBAPISet([0, 1, 3, 4, 5, 8, 9, 13])
ROWID = DBAPISet([])
STRING = DBAPISet([253, 254, 247])
TIME = DBAPISet([11])
TIMESTAMP = DBAPISet([12, 7])
__all__ = ['BINARY', 'Binary', 'Connect', 'Connection', 'DATE', 'Date'...
__author__ = 'Andy Dustman <farcepest@gmail.com>'
__revision__ = ''
__version__ = '1.2.4b4'
apilevel = '2.0'
paramstyle = 'format'
threadsafety = 1
version_info = (1, 2, 4, 'beta', 4) VERSION
1.2.4b4 AUTHOR
Andy Dustman <farcepest@gmail.com> help>

说明你的MySQLdb安装成功了。

========================================================

More reading,and english is important.

I'm Hongten

大哥哥大姐姐,觉得有用打赏点哦!多多少少没关系,一分也是对我的支持和鼓励。谢谢。
Hongten博客排名在100名以内。粉丝过千。
Hongten出品,必是精品。

E | hongtenzone@foxmail.com  B | http://www.cnblogs.com/hongten

========================================================

python开发_mysqldb安装的更多相关文章

  1. Windows上python开发--2安装django框架

    Windows上python开发--2安装django框架 分类: 服务器后台开发2014-05-17 21:22 2310人阅读 评论(2) 收藏 举报 python django 上一篇文章中讲了 ...

  2. python开发环境安装配置

    需要安装的软件: Python2.7.14和Python3.6.4   要在电脑上同时安装两个版本 开发工具:PyCharm 是一个jetbrains的python开发工具  idea系列之一 Pyt ...

  3. Python开发工具安装

    v阅读目录 v写在前面 v基本概念 vWindows搭建python开发环境 v从Hello World开始 v博客总结 v博客前言 从大学开始玩python到现在参加工作,已经有5年了,现在的公司是 ...

  4. python开发环境安装

    1.首先安装python-3.4.2.msi,此为python主程序,双击安装,根据自身的情况做选择,也可以使用默认设置,一路next也没什么问题. 2.设置环境变量=>编辑Path,在最后加上 ...

  5. python 开发环境安装(最全最完整)

    一.下载安装包 Windows64 位电脑安装 Python,浏览器的地址栏访问: https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64 ...

  6. Python开发——解释器安装

    Python(解释器)安装 Windows 1.Python(解释器)下载链接 2.选择好安装路径,点击安装即可 3.环境变量配置 [右键计算机]-->[属性]-->[高级系统设置]--& ...

  7. sublime txet 3 python 开发环境安装配置

    下载python 下载地址:https://www.python.org/downloads/windows/ 下载sublime text 3 下载地址:https://www.sublimetex ...

  8. 使用eclipse作为python开发工具安装旧版pydev

    在Eclipse中: Help->Install New Software add之后输入的链接地址 https://dl.bintray.com/fabioz/pydev/old/ 如果使用从 ...

  9. python开发_python操作mysql数据库

    如果你还没有准备好开发环境,你不妨花上一小点时间去看看:python开发_mysqldb安装 本篇blog是有关python操作mysql数据的相关内容. 我做了一个demo: 先看运行效果: mys ...

随机推荐

  1. 删除/var/lib/docker

    FATA[0000] Get http:///var/run/docker.sock/v1.18/containers/json?all=1: dial unix /var/run/docker.so ...

  2. 重构edit 和 new页面

    www.iwangzheng.com 由于edit和new页面的相似部分很多,需要提取出来,现在就是提取的方法 从form 的开始部分选中,shift+v选中对应的行 :Rextract form 然 ...

  3. 华为2013校招之哈工大威海 上机试题之一:报数问题:设有N 个人围坐一圈并按顺时针方向从1 到N 编号,从第S个人开始进行1 到M报数,报 数到第 M个人时,此人出圈,再从他的下一个人重新开始1 到 M的报数,如此进行下去直 到所有的人都出圈为止。现要打印出出圈次序。

    1.  报数游戏 问题描述: 设有N 个人围坐一圈并按顺时针方向从1 到N 编号,从第S个人开始进行1 到M报数,报 数到第 M个人时,此人出圈,再从他的下一个人重新开始1 到 M的报数,如此进行下去 ...

  4. spring3.0+Atomikos 构建jta的分布式事务 -- NO

    摘自: http://gongjiayun.iteye.com/blog/1570111 spring3.0+Atomikos 构建jta的分布式事务 spring3.0已经不再支持jtom了,不过我 ...

  5. 【转】Linux中如何安装.rpm、.tar、.tar.gz和tar.bz2

    我以下面三个包为例:(三个包都在/etc/opt下)A.example-1.2.3-1.rpmB.example-1.2.3-1.tarC.example-1.2.3-1.tar.gz 1.对于rpm ...

  6. Apache配置文件中的deny和allow的使用

    Apache配置文件中的deny和allow的使用 由于产品的需要,最近在配置apache的负载均衡功能,但是在配置虚拟主机的访问权限的时候我们遇到了一些问题.主要问题是deny和allow的执行顺序 ...

  7. powerdesigner奇淫技

    在日常开发中数据库的设计常常需要建立模型,而powerdesigner是个不错的选择.但很多时候用powerdesigner生成模型后再去创建表结构,会觉得烦和别扭.那么能不能数据库表建好后再生成模型 ...

  8. Android Studio "diamond operator is not supported" 处理方法

    低版本的android编译环境是不支持使用java7语法的,如果使用了,就会产生上述问题,如果你的android环境较新,那么可以使用以下方法: 在build.gradle的android标签下加入以 ...

  9. (转)SQL SERVER的锁机制(四)——概述(各种事务隔离级别发生的影响)

    六.各种事务隔离级别发生的影响 修改数据的用户会影响同时读取或修改相同数据的其他用户.即这些用户可以并发访问数据.如果数据存储系统没有并发控制,则用户可能会看到以下负面影响: · 未提交的依赖关系(脏 ...

  10. canvas API ,通俗的canvas基础知识(三)

    全文说到了三角形,圆形等相关图形的画法,不熟悉的同学可以出门右转,先看看前文,接下来继续我们的图形——曲线. 学过数学,或者是比较了解js 的同学都知道贝塞尔曲线,当然,在数学里面,这是一门高深的学问 ...