Using python to regularly update Mysql Data first describes this requirement: the server has two tables, album_item and album_item_inc. One is the full table, which is generated every morning and the other is the incremental table. Real-time update. I need to keep a full table and then update the incremental update every minute to this full table. 1. MySQL operation first, create a table and create a user: export the database table structure:
Mysqldump-usearch-p-B Album -- table album_item -- Port 3306> album_item. SQL
Then insert the database:
Mysql-uroot-psource <dir>/album_item. SQL
Today, I encountered a strange problem. When I used the grant statement to grant permissions, I reported an error and couldn't understand why. So I adopted a roundabout method: (1) in MySQL. insert the user into the user table (2) and then in MySQL. grant permissions to the user in the DB Table (3) Finally, use the command on the terminal to refresh the permission (flush privileges) and directly use grant select, delete, update, insert on album. * To search @ '%' identified by <password> 2. python code