Mysql5.7 yum安裝
下載rpm包
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
安裝rpm包
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
yum安裝
yum install mysql-server
service mysql start
grep "password" /var/log/mysqld.log
alter user 'root'@'localhost' identified by 'Ltw@789***';
update mysql.user set host='%' where host='localhost';
grant all on *.* to root@'%' identified by 'Ltw@789***';
flush privileges;
批量導入數據
load data infile '/data/import200.txt' into table password fields terminated by ':' lines terminated by '\n' (password, sha);
創建索引
CREATE INDEX part_of_sha1 ON password (sha1(10));