Python Operation MySQL Database series-Install MySQL database

Source: Internet
Author: User

1. First download MySQL The version I selected is 5.7.19 based on the 64-bit Windows operating system. MySQL Portal: https://dev.mysql.com/downloads/mysql/There are different operating systems installed in the installation package you need to download it yourself.

The specific installation is as follows:

1, unzip the Mysql-8.10-winx64zip compressed file to the D:\application\mysql directory;

2, in the D:\application\mysql directory to create a new my.ini configuration file;

3. Open the My.ini file with a text editor or other editor, copy and paste the following code, and save the exit;

[MySQL]
# Set the MySQL client default character set
Default-character-set=utf8
[Mysqld]
#设置3306端口
Port = 3306
# set up the MySQL installation directory

Basedir=d:\application\mysql
# Set up a storage directory for MySQL database data
Datadir=d:\application\mysql\\data

# Maximum number of connections allowed
max_connections=200
# The default character set used by the server is UTF8
Character-set-server=utf8
# The default storage engine that will be used when creating a new table
Default-storage-engine=innodb

4.1, the new system variable and the configuration variable value is D:\application\mysql;

Run command prompt cmd as Administrator (be sure to run as administrator, or not enough) input: MySQLd--initalize (mysql5.7 above must first run the change command)

Using DOS instructions, go to the D:\application\mysql directory and run the following command: myqld install

Start MySQL service: net start MySQL shutdown MySQL service: net stop MySQL

To set the root password for MySQL, run the following command : Mysql-u root-p

This will cause an error, because the MySQL password needs to be reset:

Workaround: Locate the Mysql.ini file and add the following code on the last line:skip-grant-tables and then close the MySQL service!

Then turn on the MySQL service.

At this point, the Mysql 8.0 winx64 Release configuration installation is complete!

To be continued .....

Python Operation MySQL Database series-Install MySQL database

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.