Import csdn plaintext passwords into mysql database in batches
- set_time_limit(13600); //Set time
- $conn=mysql_connect('localhost','root',''); //Connect to database
- 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';
- ?>
Copy code
|