ó n[Qc @sdZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z ddl m Z mZddl mZmZdd l mZmZmZdd l mZmZdd l mZmZdd lmZd ZdZdZd„Ze ejjej dƒeee!e"ƒZ#e#j$ddddddddddddƒe#j$ddddddddd dƒe#j$d!d"dd#dd$dd%de"ƒe#j$d&dddd'dd(dd)ƒe#j$d*d+dd,dd-dddddd.ƒee#d/ƒe e#ƒe e#e!ƒee#ƒee#ƒee#ƒee#dƒee#e"e"ƒe#j$d0dd#de"dd1dd2ƒe#j&ƒ\Z'Z(yee'j)ƒZ*Wn)ek ríZ+d3e+j,GHe-d(ƒnXe'j.dkr e#j/d4ƒne0e(ƒdkr9e'j1 r9e#j/d5ƒnee#e'e(d/ƒee'ƒid6e*kd76d8e*kd96d:e*kd;6d<e*kd=6d>e*kd?6d@e*kdA6dBe*kdC6dDe*kdE6dFe*kdG6e'j2d$6e'j3d(kdH6e'j4dI6e'j5d'6e'j3dJkdK6e'j6dL6e'j7dM6e'j8dN6e'j1dO6e'j9dP6e'j:dQ6e'j;dR6e'j<dS6e'j3dT6e'j=d16Z>y(ee>e"ƒZ?e e'j@e?e>ƒZAWne#j/dUƒnXye e'j.e?e>ƒZBWne#j/dVƒnXe'j<sôe'j;reAeBkre#j/dWƒnee#e'ƒgZCxSe(D]KZDejEdXeDƒZFeFs\e#j/dYeDƒneFjGƒZHeCjIeHƒq*WyTe'j3dJkršejƒZJnejKeAeBeCe>ƒe'j3dJkrÌeeJƒnWn)ek røZ+dZGe+j,GHe-d(ƒnXe-ƒdS([sn This file contains the copy database utility which ensures a database is exactly the same among two servers. iÿÿÿÿN(tdbcopy(tMyDefaultsReader(tsetup_common_options(tparse_connectiontadd_skip_options(t add_verbositytcheck_verbosity(tcheck_skip_optionst add_engines(tadd_allt check_allt add_locking(t add_regexpt add_rpl_mode(tcheck_rpl_optionst add_rpl_user(t UtilErrorsMySQL Utilities - mysqldbcopy s7mysqldbcopy - copy databases from one server to anothersa%prog --source=user:pass@host:port:socket --destination=user:pass@host:port:socket orig_db:new_dbcCsBtjƒ}t||dƒ}|dkr5d}nd|GHdS(sePrint the elapsed time to stdout (screen) start_test[in] The starting time of the test idiis Time: %6d N(ttimetint(t start_testt stop_testt display_time((s#..\utilities\scripts\mysqldbcopy.pytprint_elapsed_time.s    is--sourcetactiontstoretdesttsourcettypetstringtdefaultsroot@localhost:3306thelps,connection information for source server in s]the form: [:]@[:][:] or [:][:].s --destinationt destinations1connection information for destination server in s-fs--forcet store_truetforces,drop the new database or object if it existss --threadstthreadsis-use multiple threads (connections) for inserts-xs --excludetappendtexcludes/exclude one or more objects from the operation using either a specific name (e.g. db1.t1), a LIKE pattern (e.g. db1.t% or db%.%) or a REGEXP search pattern. To use a REGEXP search pattern for all exclusions, you must also specify the --regexp option. Repeat the --exclude option for multiple exclusions.t databasess --skip-gtidt skip_gtids;skip creation and execution of GTID statements during copy.s ERROR: %ss No destination server specified.s]You must specify at least one database to copy or use the --all option to copy all databases.ttablest skip_tablestviewst skip_viewsttriggerst skip_triggerst procedurest skip_procst functionst skip_funcsteventst skip_eventstgrantst skip_grantst create_dbt skip_createtdatat skip_datatverbosetquietitdebugtexclude_patternst new_enginet def_enginetalltlockingt use_regexptrpl_usertrpl_modet verbositys5Source connection values invalid or cannot be parsed.s:Destination connection values invalid or cannot be parsed.s?You cannot use the --rpl option for copying on the same server.s(\w+)(?:\:(\w+))?s*Cannot parse database list. Error on '%s'.sERROR:(Lt__doc__tostretsysRtmysql.utilities.commandRt(mysql.utilities.common.my_print_defaultsRtmysql.utilities.common.optionsRRRRRRRR R R R R RRtmysql.utilities.exceptionRtNAMEt DESCRIPTIONtUSAGERtpathtbasenametargvtTruetFalsetparsert add_optiontNonet parse_argstopttargst skip_objectstskipsteterrmsgtexitRterrortlenR?R!RDR:R"R$R=R>R@RARBRCR&toptionst config_readerRt source_valuest dest_valuestdb_listtdbtmatchtgrptgroupstdb_entryR#Rtcopy_db(((s#..\utilities\scripts\mysqldbcopy.pytsÞ