Connecting WampServer to MYSQL 2017 Database
Posted by: mcoyne (51.219.31.---)
Date: July 26, 2019 12:42PM

Sorry for the newby question: -


Trying to connect an installation of WampServer to a MYSQL 2017 database.


I have connected the Database in ODBC Data Source Administrator (64-bit) under System DSN and given it a name of FM

When running the script to testmysql i am getting the following error: -

Connect Error (2002) php_network_getaddresses: getaddrinfo failed: No such host is known.



Script: -

$mysqli = new mysqli("FM", "DB-NAME", "DB-PASSWORD", '');

if ($mysqli->connect_error) {
die('Connect Error (' . $mysqli->connect_errno . ') '
. $mysqli->connect_error);
}
echo '<p>Connection OK '. $mysqli->host_info.'</p>';
echo '<p>Server '.$mysqli->server_info.'</p>';
$mysqli->close();

The icon is Green. I am sure it is just a step i have missed out. If someone can point me in the reight direction I would be most grateful.

Options: ReplyQuote
Re: Connecting WampServer to MYSQL 2017 Database
Posted by: mcoyne (51.219.31.---)
Date: July 26, 2019 12:52PM

WAMPServer 3.1.9
Apache 2.4.39
PHP 7.2.18
MySQL 5.7.26

Green WAMP server Icon
hosts file 127.0.0.1 localhost
I have Got access to localhost
I have got access to phpMyAdmin
Antivirus currrently disabled
Installatiion c:\wamp\

Options: ReplyQuote
Re: Connecting WampServer to MYSQL 2017 Database
Posted by: RiggsFolly (Moderator)
Date: July 26, 2019 01:43PM

MYSQL 2017 ?????

Do you mean SQLServer 2017 ???

If you do, then read the relevant section of the PHP manual related to SQL Server (which is not the same as MySQL Server)

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 2 time(s). Last edit at 07/26/2019 01:46PM by RiggsFolly.

Options: ReplyQuote
Re: Connecting WampServer to MYSQL 2017 Database
Posted by: mcoyne (51.219.31.---)
Date: July 26, 2019 02:24PM

It is Database Engine: MSSQL 2017 server

Options: ReplyQuote
Re: Connecting WampServer to MYSQL 2017 Database
Posted by: RiggsFolly (Moderator)
Date: July 26, 2019 02:28PM

MSSQL === Microsoft SQL Server
MSSQL !== MySQL

That is not MySQL and to access a MSSQL database you use the functions documented in the link I gave you to read

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.9 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Connecting WampServer to MYSQL 2017 Database
Posted by: mcoyne (51.219.31.---)
Date: July 29, 2019 04:19PM

Thanks for that link, i have now connected to the database using sqlsrv_connect.

We have quite a lot of PHP reports written using ODBC, have you any advice on the best ways to rewrite these? ie are there any global find and replace functions we can use?

Options: ReplyQuote


Sorry, only registered users may post in this forum.