Python learns Day17 python for MySQL operations and uses ORM Framework (SQLAlchemy)

Source: Internet
Author: User
Tags create database

Python operation on MySQL and using ORM Framework (SQLAlchemy) MySQL common operations database operations
    • Create DATABASE Fuzjtest
    • Deleting a database Drop DB fuzjtest
    • Querying the database show databases
    • Switch database use Databas 123123 # # #用户授权
    • Create user ' user name ' @ ' IP address ' identified by ' password ';
    • Delete User ' user name ' @ ' IP address ';
    • Modify user Rename user ' username ' @ ' IP address '; To ' new user name ' @ ' IP address ';;
    • Modify password Set password for ' username ' @ ' IP address ' = password (' New password ')
    • View permissions show grants for ' user ' @ ' IP address '
    • Authorize grant permissions on the database. Table to ' user ' @ ' IP address
    • Revoke permissions on the database. Table from ' user ' @ ' IP address ' PS: User rights related data is stored in the user table in the MySQL database, so it can also be manipulated directly (not recommended)

    • Authorization database

All privileges except grant all permissions select only Check permissions Select,insert check and insert Permissions ... usage no access permission alter Use alter TABLEALTER routine with ALTER procedure and drop procedurecreate using create Tablecreate rout  Ine use create procedurecreate temporary tables using create temporary tablescreate user using create user, drop                    User, rename user, and revoke all privilegescreate view use the Create Viewdelete using Deletedrop Use the drop Tableexecute to use call and stored procedure file using SELECT INTO outfile and load data infile             Grant option uses Indexinsert with Grant and Revokeindex insertlock tables Use the lock tableprocess with show full processlistselect using Selectshow databases                Show Databasesshow view uses updatereload with show Viewupdate Flushshutdown Using MysqladmIn shutdown (off MySQL) Super???? Use change master, kill, logs, purge, master, and set global. also allows mysqladmin???????? Debug login Replication Client server location access replication slave used by replication slaves

Python learns Day17 python for MySQL operations and uses ORM Framework (SQLAlchemy)

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.