Python database operations-Installation and python database operations

Source: Internet
Author: User

Python database operations-Installation and python database operations

First, download the software:

 

Link: http://pan.baidu.com/s/1nvp1imX password: 6i0x

Then there is a series of settings.

Installation Tutorial: Just click Baidu. Note that you need to add these things when setting my. ini (to ensure that all are UTF-8 encoded and not garbled ):

[Mysql]
Default-character-set = utf8

[Mysqld]
Character-set-server = utf8
Only. Just overwrite [mysqld.

 

 

 

In addition, in cmd, how does one enable and disable mysql connection?

First open cmd and find the bin directory of the mysql installation directory. The specific method is to cd \ return to the c root directory. If the bin directory of the mysql installation directory is on the D disk, You need to first enter the D disk, and then enter D:

Then enter cd D: \... \ bin, where... indicates your directory. After finding this bin directory, you can open the database (similar to opening the QQ Software) and Use net start mysql57. Mysql57 is the name of my database, which was set when the msi database shared by Baidu cloud was installed. After starting the mysql service, You need to log on to the database (similar to logging on to the QQ number). Use mysql-uroot-p and enter the password, which is also set during msi installation.

In the cmd window, press F7 to view the previously entered command, and use the up and down arrow keys to select the previously entered command. Press shift + The up arrow key header to directly enter the previous command.

Create a database:

 

Create a DATABASE: creat database if not exist zbltest1 default character set utf8;

Shows the total number of DATABASES: show databases;

Show create database zbltest1;

Change the encoding method of a DATABASE: alter database zbltest1 DEFAULT CHARACTER SET GBK

To open a database: USE zbltest1;

To view the currently opened DATABASE: select database ();

Display warning information: show warnings;

Delete a database: drop database zbltest1; or drop datebase if exists zbltest1;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 

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.