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;