Clarification of Proof involving $\sum_{p \le x} \frac{1}{p}$ For fun I've been doing problems from M. Ram Murty's text "Problems in Analytic Number Theory". I recently encountered the following problem:
If
$$\lim_{x \rightarrow \infty} \frac{\pi(x)}{x/\log x } = \alpha $$
then show that
$$\sum_{p \le x} \frac{1}{p} = \alpha \log\log x + \underline{o}(\log \log x).$$
Deduce that if the limit exists, it must be 1.
The solution to this exercise is provided in the book. It is as follows:
By partial summation,
$$\sum_{p \le x} \frac{1}{p} = \frac{\pi(x)}{x} + \int_2^x \frac{\pi(t)}{t^2} dt = \alpha \log \log x + \underline{o}(\log \log x) $$
Since $\sum_{p \le x} \frac{1}{p} = \log \log x + O(1)$, we know that $\alpha$ must be 1.
Unfortunately, I don't completely understand this solution. I understand the argument why $\alpha$ must be 1, and the first equality in the solution makes sense to me. However, I'm unclear on how the second equality follows. Can somebody please help explain why the second equality holds? Any assistance will be much appreciated. Thank you.

For proving $$\sum_{p\leq x}\frac{1}{p}=\log\left(\log\left(x\right)\right)+O\left(1\right)$$
 we can use the Mertens second formula$$\sum_{p\leq x}\frac{\log\left(p\right)}{p}=\log\left(x\right)+O\left(1\right).$$
 So by partial summation$$\sum_{p\leq x}\frac{1}{p}=\sum_{p\leq x}\frac{1}{\log\left(p\right)}\frac{\log\left(p\right)}{p}=\frac{1}{\log\left(x\right)}\sum_{p\leq x}\frac{\log\left(p\right)}{p}+\int_{2}^{N}\sum_{p\leq t}\frac{\log\left(p\right)}{p}\frac{dt}{t\left(\log\left(t\right)\right)^{2}}=$$ $$=1+O\left(\frac{1}{\log\left(x\right)}\right)+\int_{2}^{N}\frac{dt}{t\left(\log\left(t\right)\right)}+O\left(\frac{1}{\log\left(t\right)}\right)=$$ $$=\log\left(\log\left(x\right)\right)+1-\log\left(\log\left(2\right)\right)+O\left(\frac{1}{\log\left(x\right)}\right).$$
