㈠ 如何在mysql中批量添加用戶
可以用shell寫個腳本批量添加mysql用戶:
#!/bin/bash
i=$1;
MAX_INSERT_ROW_COUNT=$2;
while[$i-le$MAX_INSERT_ROW_COUNT]
do
mysql-uopensips-popensipsrwopensips-e"insertintosubscriber(username,password)values('10$i',10$i);"
d=$(date+%M-%d\%H:%m:%S)
echo"INSERTusername10$ion$d"
i=$((i+1))
sleep0.05
done
exit0