MySQL in the additions and deletions find and view 2;

Source: Internet
Author: User
Tags mysql in

#mysql basic Commands
#1, view all databases
#show databases;
#2, creating a database
#create database dbname;
#3, using the database
#use dbname;
#4, view the tables in the library
#show tables;
#5, creating data tables
#filid int PRIMARY Key Auto_increment,name char (10)
#create Table table_name (
#field_name Field_type,
#主键 PRIMARY Key
#自增长 auto_increment
#);
#6, manipulate data in the data table
#1, increase
#insert into table_name (field,) value (data)
#2, delete
#delete from table_name where field = data;
#3, change
#update table_name SET field = data where field = data;
#4, check
#select * FROM table_name;
# * represents all fields, can be specific to the writing field
#desc table_name; View table Structure

#python mysqldb MySQL Relationship
#python is a scripting language, we write programs in Python
#mysql is the database, we use the data inventory data
#MySQLdb is the interface that Python uses to manipulate MySQL databases. It's a three-party module.
#pip Install Python-mysql
#yum Install Python-mysql

#1, install Python
#python Interactive
#2, mounting MySQLdb (2.x) Pymysql (3.x)
#import MySQLdb
#3, install MySQL
#mysql-U root-padmin

MySQL in the additions and deletions find and view 2;

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.