Python operation on MySQL and using ORM Framework (SQLAlchemy) MySQL common operations database operations
- 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 '
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)