Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行后歌单爬取正常,爬评论出现问题 #1

Open
XBisATrouble opened this issue Dec 16, 2017 · 1 comment
Open

执行后歌单爬取正常,爬评论出现问题 #1

XBisATrouble opened this issue Dec 16, 2017 · 1 comment

Comments

@XBisATrouble
Copy link

XBisATrouble commented Dec 16, 2017

centos7.3 php7.1 mysql5.7

[Illuminate\Database\QueryException]
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from user_music
where user_id = xxxxxxx limit 5 offset 30)

[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] Connection refused

[PDOException]
SQLSTATE[HY000] [2002] Connection refused

@dichen001
Copy link

配置文件夹里的环境文件 .env 像这样
image

注意,

DB_DATABASE=你的DB名字
DB_USERNAME=你的DB 用户名
DB_PASSWORD=你的DB 用户名 对应的密码

就我而言,经历了以下步骤:

  • 安装 mysql,
  • 进入 mysql
  • 建立了一个 mysql 的database,
  • 查了 port 是3306。
  • 新建了一个user 叫 test, 密码是 pass, grant 了这个user 在所有 IP的访问权限。

对了 PHP 还用 homebrew 下载了 pcntl 扩展, 然后需要修改 php.ini 文件开启 pcntl,修改完后重启PHP。

希望有帮到你。

当然,跑起来大概20分钟左右,就会被网易封掉IP。。。 需要换VPN继续。如果用户听歌数太多,目前的代码基本无解,因为还没爬完就被封了IP,再重头爬不过是循环。还需要在代码里写入自动换IP的部分。

IP切换,就寄希望于楼主了。

虽然折腾了一晚上,但是终于还跑成功了一个用户,十分感谢楼主的代码的耐心指导。🤝

加油~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants