将csdn数据库密码文件解析导入进mysql
时间:2021-07-01 10:21:17
帮助过:14人阅读
将csdn明文密码批量导入进mysql数据库
- set_time_limit(13600); //设置时间
- $conn=mysql_connect('localhost','root',''); //连接数据库
- mysql_select_db('csdn',$conn);
- mysql_query("SET NAMES utf8");
- $file=file('csdn.txt');
- foreach($file as $line)
- {
- $u=explode('# ', $line);
- mysql_query("INSERT INTO `user` (username,password,email)VALUES('".trim($u[0])."','".trim($u[1])."','".trim($u[2])."')",$conn);
- }
- echo 'OK';
- ?>
|