Python connection MySQL

Source: Internet
Author: User

Change the computer to reinstall, and record a wave

Environment configuration:

Win10;python3.6;mysql-5.7.18-winx64.zip;mysql-connector-python-2.1.6-py3.4-winx64.msi

Install Python will not say, first to download the required files

Install Mysql-5.7.18 under WIN10:

Then unzip the Mysql-5.7.18-winx64.zip, unzip and enter the directory to create a new My.ini file, write the following code:

[MySQL]
# Set the MySQL client default character set
Default-character-set=utf8

[Mysqld]
#设置3306端口
Port = 3306
# set up the MySQL installation directory
Basedir= # Write the installation path to mysql-5.7.13-winx64, such as: D:\mysql-5.7.13-winx64
# Set up a storage directory for MySQL database data
datadir= # mysql-5.7.13-winx64 Installation path \data is written here, such as: D:\mysql-5.7.13-winx64\data
# Maximum number of connections allowed
max_connections=200
# The character set used by the service side defaults to the 8-bit encoded latin1 character set
Character-set-server=utf8
# The default storage engine that will be used when creating a new table
Default-storage-engine=innodb

Then create a new file in the same directory named data, and then open the CMD input as follows:

If there is an error in the install step "cannot continue executing code because MSVCR120.dll cannot be found", the workaround is as follows:

Download and install the Microsoft vc++2013 version Runtime ()

Microsoft Visual C + + redistributable Package

Python connection MySQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.