MySQL数据库的英文单词? [英] MySQL database of english words?

查看:516
本文介绍了MySQL数据库的英文单词?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找我正在开发的密码应用程序的英文字典单词列表。
理想情况下,列表可以轻松插入到mysql数据库中。
任何建议?

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?

推荐答案

大多数Unix系统都有一套单词列表,在我的Ubuntu系统中它是/ usr / share / dict / american-english

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.

这个bash oneliner效率不高:

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>

此MySQL命令可以有效地执行(如果文件位于同一台机器中):

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;

这篇关于MySQL数据库的英文单词?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆