Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Skrypt typera - błąd z połączeniem do bazy.
Forum PHP.pl > Forum > Bazy danych
ozeksportu
Witam,

Prowadzę stronę internetową o tematyce piłkarskiej i chciałem dołożyć do niej typer, więc wybrałem "Prediction Football", lecz podczas instalacji wywala mi błąd mysql:

  1. Unable TO CREATE DATABASE psor_1. Make sure psor_1 does NOT already exist


Nie mam pojęcia dlaczego, wszystko wpisuje (wydaje mi się) dobrze, lecz cały czas wywala ten błąd. Czym to może być spowodowane? Podkreślę, że mam hosting na płatnym serwerze nazwa.pl.

Pozdrawiam.
pitu
W błędzie masz informację, że tabela psor_1 istnieje i nie może jej stworzyć.
ozeksportu
Próbowałem już wszelakich sposobów i nie mogę do tego dojść. Tutaj podaję plik, który musi być odpowiednio zmodyfikowany pod moją bazę:

Dodam, że user bazy to: psor_1, nazwa bazy to psor_1 i host to psor.nazwa.pl:3307

Wydaje mi się, że wszystko wpisuje ok, a jednak ciągle coś wywala.

  1. <?php
  2. error_reporting(E_ALL & ~E_NOTICE);
  3. /*********************************************************
  4.  * Author: John Astill (c)
  5.  * Date : 10th December 2001
  6.  * File : systemvars.php
  7.  * Desc : Global data definitions. This is where the
  8.  * : prediction league is configured for the
  9.  * : specific installation.
  10.  ********************************************************/
  11. require "userclass.php";
  12. require "logfunctions.php";
  13. require "error.php";
  14.  
  15. //////////////////////////////////////////
  16. // System variable and configuration
  17. //////////////////////////////////////////
  18. //////////////////////////////////////////
  19. // Constants
  20. //////////////////////////////////////////
  21. define("VERSION","1.12");
  22.  
  23. /////////////////////////////////////////////////
  24. // Default points for scoring, this can be
  25. // set in the config screen.
  26. /////////////////////////////////////////////////
  27. $corrHomeScore = 1;
  28. $corrAwayScore = 1;
  29. $corrMargin = 1;
  30. $corrResult = 1;
  31. $corrScore = 3;
  32.  
  33. //////////////////////////////////////////////////////////////
  34. // Modify the values from here to where you are told to stop.
  35. // The numbers match those in the installation steps in
  36. // the file INSTALL.TXT.
  37. //////////////////////////////////////////////////////////////
  38. //////////////////////////////////////////
  39. // 1.Prediction League Title
  40. // The title of the Prediction League.
  41. // Change the value between the "" to
  42. // give the prediction league the title
  43. // of your choice
  44. //////////////////////////////////////////
  45. $PredictionLeagueTitle = "Prediction Football.com";
  46.  
  47. //////////////////////////////////////////////////////////////
  48. // 2. Header Row
  49. // This is the header to be displayed in
  50. //all the pages. It can contain HTML code.
  51. //////////////////////////////////////////////////////////////
  52. $HeaderRow = "<table cellpadding=\"0\" cellspacing=\"0\"><tr><td align=\"center\" class=\"TBLHEAD\"><font class=\"TBLHEAD\"><img border=\"0\" src=\"banner.jpg\"></font></td></tr></table>";
  53.  
  54. //////////////////////////////////////////////////////////////
  55. // 3. Database hostname
  56. // Database hostname
  57. // The fqdn of the host containing the
  58. // database
  59. //////////////////////////////////////////////////////////////
  60. $dbaseHost = "psor.nazwa.pl:3307";
  61.  
  62. //////////////////////////////////////////////////////////////
  63. // 4. Base Directory Name
  64. // The directory storing the prediction
  65. // league files
  66. //////////////////////////////////////////////////////////////
  67. $baseDirName = "typer";
  68.  
  69. //////////////////////////////////////////////////////////////
  70. // 5. Username
  71. // User name
  72. // The username to be used for logging
  73. // into the database
  74. //////////////////////////////////////////////////////////////
  75. $dbaseUsername = "psor_1";
  76.  
  77. //////////////////////////////////////////////////////////////
  78. // 6. Password
  79. // Password to be used for logging into
  80. // the database
  81. //////////////////////////////////////////////////////////////
  82. $dbasePassword = "haslo";
  83.  
  84. //////////////////////////////////////////////////////////////
  85. // 7. Database Name.
  86. // This is the name of the database. This *MUST* be the same
  87. // name as the name you used when creating the database.
  88. //////////////////////////////////////////////////////////////
  89. $dbaseName = "psor_1";


Podczas instalacji, gdy zaznaczam by stworzyło tylko tabele (bez bazy) to wyskakuje taki błąd:

  1. Query failed: CREATE TABLE psor_1.pluserdata (lid int NOT NULL , userid int NOT NULL AUTO_INCREMENT, username varchar(32) NOT NULL , password varchar(40), email varchar(60), icon varchar(128), lang varchar(32), usertype smallint, dflths smallint DEFAULT 0, dfltas smallint DEFAULT 0, since DATE, auto enum('Y','N') DEFAULT 'N', PRIMARY KEY (lid,userid));
  2. Incorrect TABLE definition; there can be only one auto COLUMN AND it must be defined AS a KEY
weedget
Jeśli zrobisz tak:
  1. CREATE TABLE psor_1.pluserdata (lid int NOT NULL , userid int NOT NULL AUTO_INCREMENT, username varchar(32) NOT NULL , password varchar(40), email varchar(60), icon varchar(128), lang varchar(32), usertype smallint, dflths smallint DEFAULT 0, dfltas smallint DEFAULT 0, since DATE, auto enum('Y','N') DEFAULT 'N', PRIMARY KEY (userid));


  1. ALTER TABLE `pluserdata` DROP PRIMARY KEY, ADD PRIMARY KEY (`userid`, `lid`);


to powinno zadziałać smile.gif
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.