Guest User

Untitled

a guest
Aug 7th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Looking for a MySQL query command to insert all the queries in local .sql file to the MySQL database on a remote server
  2. my $hostname = "remote_server_address";
  3. my $dsn = "DBI:mysql:dbname:$hostname";
  4. my $user = "user";
  5. my $password = "password";
  6. my $dbh= DBI->connect($remote)dsn, $user, $pw) );
  7. my $myquery = "SPECIAL_INSERT_QUERYCOMMAND my_local_mysql_query_file.sql";
  8. my $execute = $dbh->prepare($myquery);
  9. $execute->execute;
  10.  
  11. cat my_local_mysql_query_file.sql | mysql -uuser -ppassword dbname
  12.  
  13. mysql -uuser -ppassword dbname < my_local_mysql_query_file.sql
Add Comment
Please, Sign In to add comment