I:
Mysqlcmd = "mysql-h $ {mysql_host}-p $ {mysql_port}-U $ {mysql_user}-p $ {mysql_pass}" create_table_ SQL = "CREATE TABLE if not exists $ {mysql_db_name }. $ {access_table_name} (ID int (10) Not null auto_increment, accid int (10) Not null, URL int (10) Not null ,.... primary Key (ID), index URL (URL) Collate = 'utf8 _ general_ci 'ENGINE = myisamrow_format = defaultauto_increment = 1 "empty_table_ SQL =" truncate $ {mysql_db_name }. $ {table_name} "Echo $ create_table_ SQL | $ {mysqlcmd} echo $ empty_table_ SQL |$ {mysqlcmd} insert and other operations are the same
II:
Loadsql = "load data low_priority local infile '$ {log_temp}' into Table $ {mysql_db_name }. $ {table_name} fields terminated by '& 'Lines terminated by' \ n' (ID, URL .....); "mysql-h $ {mysql_host}-p $ {mysql_port}-U $ {mysql_user}-p' $ {mysql_pass} '-n-e" $ {loadsql} "insert, etc. same operation