Detailed explanation of the steps to install the database in Python

PHP中文网
Release: 2017-06-20 16:37:08
Original
3136 people have browsed it

First, download the software:

Link: Password: 6i0x

After that, there is a series of settings.

Installation tutorial: Just use Baidu yourself. It should be noted that when setting my.ini, you need to add these things (to ensure that all are utf8 encoded and not garbled):

[mysql]
default-character-set=utf8

[mysqld]
character-set-server=utf8
will do. Just cover [mysqld].

In addition, how to open and close in cmd and connect to mysql?

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

and then enter: cd D:\. ..\bin , where... means your directory. After finding this bin directory, you can open the database (similar to opening QQ software), use net start mysql57. Among them, mysql57 is the name of my database, which was set when installing the database msi shared by Baidu Cloud. After starting the mysql service, you need to log in to the database (similar to logging in to your QQ account). Use mysql -uroot -p, and then enter the password. The password is also set when installing msi.

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

Create a database:

Create a database: CREAT DATABASE IF NOT EXIST zbltest1 DEFAULT CHARACTER SET utf8;

Display a total of several databases: SHOW DATABASES;

Display a database information: SHOW CREATE DATABASE zbltest1;

Change a database encoding method: ALTER DATABASE zbltest1 DEFAULT CHARACTER SET GBK

Want to open a database: USE zbltest1;

Want 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;

##

The above is the detailed content of Detailed explanation of the steps to install the database in Python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template