I'm looking for a list of English dictionary words for a password application I'm working on. Ideally the list can be easily inserted to a mysql database. Any suggestions?
+8
A:
Most Unix systems have a set of word lists, in my Ubuntu system it is on /usr/share/dict/american-english
A single word comes per line, so it's easy to insert if you really want it in a database.
This bash oneliner does it inefficiently:
cat /usr/share/dict/american-english \
| while read i; do echo insert into wordlist\(word\) VALUES \(\"$i\"\); done \
| mysql -u<user> -p<pass> <db>
This MySQL command does it efficiently (if the file is in the same machine):
LOAD DATA LOCAL INFILE '/usr/share/dict/american-english' INTO TABLE wordlist;
Vinko Vrsalovic
2009-07-11 17:45:47
+7
A:
For importing a word list to MySQL, use
LOAD DATA LOCAL INFILE '/usr/share/dict/words' INTO TABLE words;
where words
is a single-column table.
Søren Løvborg
2009-07-11 18:00:03
Upvoted, edited my answer to incorporate this!
Vinko Vrsalovic
2009-07-11 18:20:02