Skip to content

Instantly share code, notes, and snippets.

@yalla
Created September 28, 2011 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yalla/958de0d848c01090cb9d to your computer and use it in GitHub Desktop.
Save yalla/958de0d848c01090cb9d to your computer and use it in GitHub Desktop.
stackoverflow.com 960800 - populate script
#!/usr/bin/perl
use strict;
use DBI;
use DBD::mysql;
my $user = "user7565497";
my $passwd = "KiFeeng3";
my $db = "db7565497";
my $dbh = DBI->connect("dbi:mysql:$db:127.0.0.1:3306", $user, $passwd);
my $Q_INSERT = 'INSERT INTO profiles (id) VALUES (?)';
my $S_INSERT = $dbh->prepare($Q_INSERT);
for (my $i=1; $i<=2000000; $i++) {
$S_INSERT->execute(int(rand(2))+1);
}
END {
$dbh->disconnect if defined($dbh);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment