Home > Backend Development > PHP Tutorial > Parse the csdn database password file and import it into mysql

Parse the csdn database password file and import it into mysql

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-25 09:08:26
Original
1074 people have browsed it
Import csdn plaintext passwords into mysql database in batches
  1. set_time_limit(13600); //Set time
  2. $conn=mysql_connect('localhost','root',''); //Connect to database
  3. mysql_select_db('csdn',$conn) ;
  4. mysql_query("SET NAMES utf8");
  5. $file=file('csdn.txt');
  6. foreach($file as $line)
  7. {
  8. $u=explode('# ', $line);
  9. mysql_query("INSERT INTO `user` (username,password,email)VALUES('".trim($u[0])."','".trim($u[1])."','" .trim($u[2])."')",$conn);
  10. }
  11. echo 'OK';
  12. ?>
Copy code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template