Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Looking for a MySQL query command to insert all the queries in local .sql file to the MySQL database on a remote server
- my $hostname = "remote_server_address";
- my $dsn = "DBI:mysql:dbname:$hostname";
- my $user = "user";
- my $password = "password";
- my $dbh= DBI->connect($remote)dsn, $user, $pw) );
- my $myquery = "SPECIAL_INSERT_QUERYCOMMAND my_local_mysql_query_file.sql";
- my $execute = $dbh->prepare($myquery);
- $execute->execute;
- cat my_local_mysql_query_file.sql | mysql -uuser -ppassword dbname
- mysql -uuser -ppassword dbname < my_local_mysql_query_file.sql
Add Comment
Please, Sign In to add comment