Steps to install a database in Python

Source: Internet
Author: User
The first is to download the software:

Link: Password: 6i0x

This is followed by a series of settings.

Installation Tutorial: Self-Baidu on the line. It is important to note that these things need to be added when setting up My.ini (to ensure that all UTF8 are encoded and not garbled):

[MySQL]
Default-character-set=utf8

[Mysqld]
Character-set-server=utf8
Just fine. Cover [mysqld] on the line.

How else can I turn it off in cmd and connect to MySQL?

First open cmd and find the bin directory of the MySQL installation directory. The practice is cd\ return to the C packing directory, if the MySQL installation directory in the bin directory on the D disk, you need to enter the D disk, the practice is to enter D:

Then enter: CD D:\...\bin, where ... Indicates that it is your directory. Find this Bin directory can open the database (similar to open QQ software), with net start mysql57. Where mysql57 is the name of my database, is set when installing the database MSI shared by Baidu Cloud. After starting the MySQL service login database (similar to the QQ number), with Mysql-uroot-p, and then enter the password, the password is also installed MSI set.

In the cmd window, press F7 to see the previously entered command and use the UP and DOWN ARROW keys to select the previously entered command. Press the shift+ up ARROW key to enter the previous command directly.

To create a database:

Create a database: creat IF not EXIST zbltest1 DEFAULT CHARACTER SET UTF8;

Shows a total of several databases: show DATABASES;

Displays a database information: show CREATE databases Zbltest1;

Change the way a database is encoded: Alter DB zbltest1 DEFAULT CHARACTER SET GBK

Want to open a database: use Zbltest1;

To view the currently open databases: SELECT database ();

Display warning message: show WARNINGS;

Delete a database: Drop DB zbltest1; or DROP datebase IF EXISTS zbltest1;

Related Article

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.