php can't connect to MySQL

Forum for you who has PHP installation issues

Moderators: egami, macek, gesf

Post Reply
sunnymaggie
New php-forum User
New php-forum User
Posts: 2
Joined: Sun Jun 18, 2017 7:49 pm

Sun Jun 18, 2017 7:56 pm

Installed Apache 2.4, PHP 5.6, MySQL 5.7 successfully.

But, php can't connect to MySQL (tested both mysqli and PDO), both not working.

phpinfo page shown mysqlnd installed.

please help.

User avatar
hyper
php-forum Active User
php-forum Active User
Posts: 380
Joined: Mon Feb 22, 2016 5:52 pm

Mon Jun 19, 2017 1:57 pm

Have you created a database?

Would suggest to only use pdo to connect to database as MySQL functions are deprecated and will not work in php 7, (MySQL will still be used, but connect through PDO).

Please post code using the </> button in the post a reply box.

sunnymaggie
New php-forum User
New php-forum User
Posts: 2
Joined: Sun Jun 18, 2017 7:49 pm

Tue Jun 27, 2017 8:37 am

Reformat windows, now phpinfo shown mysql, mysqli, and mysqlnd installed. Everything is working fine now.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest