Reputation:
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?
Upvotes: 13
Views: 7282
Reputation: 49813
I found this : MySQL formatted english words list
dunno much about how many words are not in but it's a huge list anyway :)
There are about 128/129K words in it and words longer than 10 letters have been removed.
Upvotes: 3
Reputation: 340311
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;
Upvotes: 22
Reputation: 8751
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.
Upvotes: 20