Python 3 MySQL Library operations

Source: Internet
Author: User

Python 3 MySQL Library operations one, basic related knowledge

MySQL database basic Operation knowledge Reserve

Database server: One computer (high memory requirements)

Database management system: Like MySQL, is a software

Database: Oldboy_stu, equivalent to Folder

Table: Student,scholl,class_list, equivalent to a specific file

Record: 1 Liu Hailong 324245234 22, equivalent to one line of content in a file

II. Introduction to SQL language

SQL (structured query Language, structured queries language)

The SQL language is primarily used to access data, query data, update data, and manage relational database systems, which are developed by IBM. There are 3 types of SQL languages:

DDL statement Database Definition Language: Database, table, view, index, stored procedure,

For example, create DROP ALTER

DML statement Database manipulation language: Inserting data insert, deleting data Delete, updating data update, querying data Select

DCL Statement Database Control Language: for example, to control user access rights grant, REVOKE

Third, the system database

INFORMATION_SCHEMA: Virtual library, do not occupy disk space, storage is the database startup parameters, such as user table information, column information, permission information, character information, etc.

Performance_schema:mysql 5.5 started a new database: Mainly used to collect database server performance parameters, record the processing of query requests occurred in various events, locks and other phenomena

MySQL: Authorization library, access information for primary storage system users

mysql5.7 adds the SYS system database, which provides a quick overview of the system's meta-data information.

mysql5.7 official has deleted the test database, the default after installation is no test database, even if the user created the test library, you can also control the test library permissions!

Iv. Creating a Database

1 syntax (help CREATE DATABASE)

Create database name CharSet UTF8;

2 Database Naming conventions

can be by letter, number, underscore, @, #, $ case-sensitive uniqueness cannot use keywords such as create select cannot use the number maximum 128 bits alone

3 database-related operations

1, show databases;   View all Databases 2, show create database db_name;    View how the database was created 3, select Database ();   View Current Database 4, use database name   Select Database (Enter a database)5, Dorp database name;    Delete Databases 6, ALTER DATABASE DB1 charset UTF8;   Modifying the database character set

Python 3 MySQL Library operations

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.