Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [HTML][MySQL][PHP]create_admin_table.php - nic się nie dzieje
Forum PHP.pl > Forum > Przedszkole
micesz228
Robię zgodnie z poradnikiem.
Wg poradnika po wklepaniu linku >> http://www.sklepowo.ugu.pl/storescripts/cr...admin_table.php <<
(robiłem też z http://localhost/MyOnlineStore/storescript...dmin_table.php)

powinno się wyświetlic:

Your admin table has been created succesfully!

a mi się wyświetla:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /virtual/s/k/sklepowo.ugu.pl/storescripts/connect_to_mysql.php on line 19
could not connect to mysql


connect_to_mysql
  1. <?php
  2. // Created BY Adam Khoury @ www.flashbuilding.com - 6/19/2008
  3. /*
  4. 1: "die()" will exit the script and show an error statement if something goes wrong with the "connect" or "select" functions.
  5. 2: A "mysql_connect()" error usually means your username/password are wrong
  6. 3: A "mysql_select_db()" error usually means the database does not exist.
  7. */
  8. // Place db host name. Sometimes "localhost" but
  9. // sometimes looks like this: >> questionmark.gif?mysql??.someserver.net
  10. $db_host = "localhost";
  11. // Place the username for the MySQL database here
  12. $db_username = "micesz229";
  13. // Place the password for the MySQL database here
  14. $db_pass = "password";
  15. // Place the name for the MySQL database here
  16. $db_name = "micesz229_mystore";
  17.  
  18. // Run the actual connection here
  19. mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
  20. mysql_select_db("$db_name") or die ("no database");
  21. ?>


create_admin_table
  1. <?php
  2. // Connect to the file above here
  3. require "connect_to_mysql.php";
  4.  
  5.  
  6. ?>




Używam programu XAMPP/DREAMWEAVER/FILEZILLA




Może ktoś napisać mi gdzie jest błąd?
nospor
No przecież masz napisane: "Nie można połączyć się z mysql"....
Masz mysql zainstalowane? Masz mysql wystartowane?
micesz228
APACHE I MYSQL są wystartowane na zielono. w xampp control.

Wiem co jest napisane ale nie wiem dlaczego się nie łączy;/


Wcześniej w poradniku pokazano jak zrobić test czy łączy się z bazą
http://www.sklepowo.ugu.pl/storescripts/mysql_quicktest.php -to działa
nospor
No to może mysql chodzi na innym porcie niż domyślny 3306 lub port 3306 jest zajęty przez coś innego
micesz228
Apache 80,443
mysql 3306

Jakis pomysl?

netstat -a nie pokazuje niczego innego co mogloby uzywac portu 3306


Dobra juz dziala..szkoda ze na gotowcu.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.