mysql python image

连接mysql数据库:
cnx = mysql.connector.connect(user='joe', database='test')

        Connector/Python参数列表

Argument NameDefaultDescription
user (username*) The user name used to authenticate with the MySQL server.
password (passwd*) The password to authenticate the user with the MySQL server.
database (db*) The database name to use when connecting with the MySQL server.
host127.0.0.1The host name or IP address of the MySQL server.
port3306The TCP/IP port of the MySQL server. Must be an integer.
unix_socket The location of the Unix socket file.
use_unicodeTrueWhether to use Unicode.
charsetutf8Which MySQL character set to use.
collationutf8_general_ciWhich MySQL collation to use.
autocommitFalseWhether to autocommit transactions.
time_zone Set the time_zone session variable at connection time.
sql_mode Set the sql_mode session variable at connection time.
get_warningsFalseWhether to fetch warnings.
raise_on_warningsFalseWhether to raise an exception on warnings.
connection_timeout(connect_timeout*) Timeout for the TCP and Unix socket connections.
client_flags MySQL client flags.
bufferedFalseWhether cursor objects fetch the results immediately after executing queries.
rawFalseWhether MySQL results are returned as is, rather than converted to Python types.
ssl_ca File containing the SSL certificate authority.
ssl_cert File containing the SSL certificate file.
ssl_key File containing the SSL key.
ssl_verify_certFalseWhen set to True, checks the server certificate against the certificate file specified by the ssl_ca option. Any mismatch causes a ValueError exception.
force_ipv6FalseWhen set to True, uses IPv6 when an address resolves to both IPv4 and IPv6. By default, IPv4 is used in such cases.
dsn Not supported (raises NotSupportedError when used).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值