djdonal3000
djdonal3000

Reputation:

MySQL database of english words?

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

Answers (4)

Filippo oretti
Filippo oretti

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

Vinko Vrsalovic
Vinko Vrsalovic

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

S&#248;ren L&#248;vborg
S&#248;ren L&#248;vborg

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

fortran
fortran

Reputation: 76067

http://wordlist.sourceforge.net/

Upvotes: 5

Related Questions