Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Zugriff auf MySQL DB von extern mit PHP

Empfohlene Antworten

Veröffentlicht

Hi,

hab 2 Webserver einer mit IIS einer mit Apache und MySQL.

Gibt man auf dem Apache folgendes ein:

$db = mysql_connect("localhost","user","pw");

funcktioniert es.

Ändert man dann localhost auf den PC Namen zb "Webserver1" geht es nicht mehr.

--> Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ...

Dummerweise möchte ich vom IIS auf den MySQL Server des Apachewebservers zugreifen und dort kann ich ja schlecht "localhost" eintippen :bimei

Ich habs mit Hostnamen und IP probiert, beides ohne Erfolg.

MySQL 4.1.12

PHP 5.0.4

Danke für eure Hilfe!!

Gruß Scratch

$db = mysql_connect("localhost","user","pw");

funcktioniert es.

Schau dir mal die Benutzerberechtigungen an, wahrscheinlich ist dort eingestellt, dass der Benutzer "user" nur vom localhost aus zugreifen darf, oder es ist in der my.cnf die Option SkipNetworking gesetzt, was nur Zugriffe vom localhost erlaubt, oder der MySQL Server hat in der my.cnf einen Bind auf localhost (127.0.0.1).

$db = mysql_connect("localhost","user","pw");

Oder versuche über die Fehlermeldung mehr zu erfahren:


$db = mysql_connect("Webserver1","user","pw") or die("Fehler bei der Verbindung zur MySQL-Datenbank: ".mysql_error());

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.