MySQL硬盘实例测试之裤子搭建

裤子搭建过程(未完成):

一, 安装新实例

/usr/local/mysql/bin/mysqld –defaults-file=/data/mysql/3306/my.cnf –basedir=/usr/local/mysql –datadir=/data/mysql/3306/data –plugin-dir=/usr/local/mysql/lib/plugin –user=mysql –log-error=/data/mysql/3306/mysql_run.err –open-files-limit=65536 –pid-file=/data/mysql/3306/pid_mysql.pid –socket=/data/mysql/3306/mysqltmp/mysql.sock –port=3306

mysqld –initialize –user=mysql –console

1
mysqld --defaults-file=/opt/data/mysql/var/my.cnf --basedir=/usr/local/Cellar/mysql/5.7.11 --datadir=/opt/data/mysql/data --plugin-dir=/usr/local/Cellar/mysql/5.7.11/lib/plugin --user=mysql --log-error=/opt/data/mysql/var/mysql_run.err --open-files-limit=2048 --pid-file=/opt/data/mysql/var/pid_mysql.pid --socket=/opt/data/mysql/var//mysql.sock --port=3307 --initialize --user=mysql --console

注意尾部有: mysqld --initialize --user=mysql --console
错误: 2017-02-13T06:47:11.067815Z 0 [Warning] Could not increase number of max_open_files to more than 7168 (request: 65536)

生成后, 通过日志文件找到新实例的密码为:
2017-02-13T06:50:20.157831Z 1 [Note] A temporary password is generated for root@localhost: Gbovl1rilt;Q

执行启动应用:
mysqld –defaults-file=/opt/data/mysql/var/my.cnf –basedir=/usr/local/Cellar/mysql/5.7.11 –datadir=/opt/data/mysql/data –plugin-dir=/usr/local/Cellar/mysql/5.7.11/lib/plugin –user=mysql –log-error=/opt/data/mysql/var/mysql_run.err –open-files-limit=2048 –pid-file=/opt/data/mysql/var/pid_mysql.pid –socket=/opt/data/mysql/var//mysql.sock –port=3307

进入mysql-cli后修改密码 : set password = password(‘root’);

二, 社工库操作

2.1 数据导入的方法合集

mysql-cli中导入:

source xxx.sql;
LOAD DATA INFILE ‘~/Downloads/2345.csv’ INTO TABLE tmp FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘“‘ LINES TERMINATED BY ‘\n’ IGNORE 1 ROWS;

/Volumes/BoxHD/db/SGK/163

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
LOAD DATA INFILE '/Volumes/BoxHD/db/SGK/163/1.txt' \
INTO TABLE account \
FIELDS TERMINATED BY ',' \
ENCLOSED BY '"' \
LINES TERMINATED BY '\n' \
-- IGNORE 1 LINES \
(name, password);
LOAD DATA INFILE '/Volumes/BoxHD/db/SGK/163/2.txt' \
INTO TABLE account \
FIELDS TERMINATED BY ' ' \
ENCLOSED BY '"' \
LINES TERMINATED BY '\n' \
(name, password);
LOAD DATA INFILE '/Volumes/BoxHD/db/SGK/163/3.txt' \
INTO TABLE account \
FIELDS TERMINATED BY '\t' \
ENCLOSED BY '"' \
LINES TERMINATED BY '\n' \
(name, password);