Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

AMXBANS - brak połączania z bazą danych


  • Zamknięty Temat jest zamknięty
26 odpowiedzi w tym temacie

#1 bakul. <3

    Wszechmogący

  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 12:20

Witam, mam serwer oraz forum na jednym dedyku. Zrobiłem bazę danych, zainstalowałem AMXBans. Z instalacją na www nie było problemu. Dopiero gdy doszło do edycji pliku sql.cfg wystąpił problem. Plik wygląda tak:

// SQL configuration file
// File location: $moddir/addons/amxmodx/configs/sql.cfg

// *NOTE* Linux users may encounter problems if they specify "localhost" instead of "127.0.0.1"
// We recommend using your server IP address instead of its name

// *NOTE* amx_sql_type specifies the DEFAULT database type which admin.sma will use.

amx_sql_host "91.205.74.22"
amx_sql_user "bany"
amx_sql_pass "*****"
amx_sql_db "bany"
amx_sql_table "admins"
amx_sql_type "mysql"

Jestem pewien, że dane do bazy zostały dobrze wpisane, jedynie co mnie zastanawia to czy dobrze wpisałem amx_sql_host bo nic innego nie przyszło mi do głowy.

Link do AMXBans: http://my-skill.pl/bany

Wie ktoś w czym może być problem?
  • +
  • -
  • 0

#2 DB

    Wszechwidzący

  • Użytkownik

Reputacja: 19
Początkujący

  • Postów:230
Offline

Napisano 29.06.2009 12:25

proponuje zamiast tego ip dać 127.0.0.1 lub poprostu localhost. Sprawdź dostęp do bazy - z localhost domyślnie powinien być i podejrzewam że jak wpiszesz localhost to będzie śmigać
  • +
  • -
  • 0

#3 FlameS

    Zaawansowany

  • Użytkownik

Reputacja: 7
Nowy

  • Postów:97
  • GG:
  • Lokalizacja:Częstochowa
Offline

Napisano 29.06.2009 12:52

Trzeba zezwolić na łączenie się zew... z bazą danych mysql ;]
  • +
  • -
  • 0

#4 bakul. <3

    Wszechmogący

  • Autor tematu
  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 13:09

Na localhost niestety nie działa.

FlameS, jak uzyskać ten dostęp?
  • +
  • -
  • 0

#5 disiz`

    Pomocny

  • Użytkownik

Reputacja: 8
Nowy

  • Postów:69
  • Lokalizacja:nn
Offline

Napisano 29.06.2009 13:11

Co jest w logach amxx'a ?
  • +
  • -
  • 0

#6 bakul. <3

    Wszechmogący

  • Autor tematu
  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 13:12

L 06/29/2009 - 07:59:01: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 16
L 06/29/2009 - 07:59:01: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to MySQL server on '91.205.74.22' (111) (2003)
L 06/29/2009 - 07:59:01: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 07:59:01: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 07:59:01: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 17
L 06/29/2009 - 07:59:01: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to MySQL server on '91.205.74.22' (111) (2003)
L 06/29/2009 - 07:59:01: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 07:59:02: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 07:59:02: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 16
L 06/29/2009 - 07:59:02: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to MySQL server on '91.205.74.22' (111) (2003)
L 06/29/2009 - 07:59:02: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 07:59:02: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 07:59:02: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 17
L 06/29/2009 - 07:59:02: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to MySQL server on '91.205.74.22' (111) (2003)
L 06/29/2009 - 07:59:02: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 07:59:04: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 07:59:04: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 16
L 06/29/2009 - 07:59:04: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to MySQL server on '91.205.74.22' (111) (2003)
L 06/29/2009 - 07:59:04: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 07:59:04: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 07:59:04: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 17
L 06/29/2009 - 07:59:04: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to MySQL server on '91.205.74.22' (111) (2003)
L 06/29/2009 - 07:59:04: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 07:59:05: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 07:59:05: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 16
L 06/29/2009 - 07:59:05: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to MySQL server on '91.205.74.22' (111) (2003)
L 06/29/2009 - 07:59:05: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 07:59:05: [amxbans.amxx] [Amxbans] Polaczenie nieudane!


  • +
  • -
  • 0

#7 Portek

    Kończymy zabawę, permanentna emerytura!

  • Przyjaciel

Reputacja: 976
Master

  • Postów:3 007
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Częstochowa
Offline

Napisano 29.06.2009 13:13

Jestem pewien, że dane do bazy zostały dobrze wpisane, jedynie co mnie zastanawia to czy dobrze wpisałem amx_sql_host bo nic innego nie przyszło mi do głowy.

O ile to co podałeś w tym cvarze to IP dedyka to jest wszystko ok, zaloguj się do Amxbans, wejdź w zakładkę "Serwery" i sprawdź czy połączyły się poprawnie, choć zakładam że tak.

L 06/29/2009 - 07:59:04: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 07:59:05: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 07:59:05: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 16
L 06/29/2009 - 07:59:05: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to MySQL server on '91.205.74.22' (111) (2003)


To aby na pewno dobre IP?

Dostępu do bazy nie trzeba nadawać, bo wszystko jest w obrębie jednej maszyny, localhosta który jest dopuszczany do bazy.
  • +
  • -
  • 0

serwer-1.png
IP: ts3.cserwerek.pl


#8 bakul. <3

    Wszechmogący

  • Autor tematu
  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 13:15

No mam listę serwerów, pokazuje ile slotów itp.
  • +
  • -
  • 0

#9 disiz`

    Pomocny

  • Użytkownik

Reputacja: 8
Nowy

  • Postów:69
  • Lokalizacja:nn
Offline

Napisano 29.06.2009 13:15

Wywal to w cholere
amx_sql_table "admins"

albo zamień na
amx_sql_table "amx_amxadmins"

czy tam nie wiem jaki masz prefix.
  • +
  • -
  • 0

#10 bakul. <3

    Wszechmogący

  • Autor tematu
  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 13:29

Przy localhost są takie logi:

L 06/29/2009 - 08:24:55: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (2002)
L 06/29/2009 - 08:24:55: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 08:25:06: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 08:25:06: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 16
L 06/29/2009 - 08:25:06: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (2002)
L 06/29/2009 - 08:25:06: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 08:25:06: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 08:25:06: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 17
L 06/29/2009 - 08:25:06: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (2002)
L 06/29/2009 - 08:25:06: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 08:25:10: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 08:25:10: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 16
L 06/29/2009 - 08:25:10: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (2002)
L 06/29/2009 - 08:25:10: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 08:25:10: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 08:25:10: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 17
L 06/29/2009 - 08:25:10: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (2002)
L 06/29/2009 - 08:25:10: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 08:25:24: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 08:25:24: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 16
L 06/29/2009 - 08:25:24: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (2002)
L 06/29/2009 - 08:25:24: [amxbans.amxx] [Amxbans] Status zapytania:
L 06/29/2009 - 08:25:25: [amxbans.amxx] [Amxbans] Polaczenie nieudane!
L 06/29/2009 - 08:25:25: [amxbans.amxx] [Amxbans] Blad zapyania, lokacja: 17
L 06/29/2009 - 08:25:25: [amxbans.amxx] [Amxbans] Wiadomosc: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (2002)


  • +
  • -
  • 0

#11 disiz`

    Pomocny

  • Użytkownik

Reputacja: 8
Nowy

  • Postów:69
  • Lokalizacja:nn
Offline

Napisano 29.06.2009 13:40

Odpal serwer mysql i wpisz tak:
netstat -ln | grep mysql
Wklej co zwróciło.
  • +
  • -
  • 0

#12 bakul. <3

    Wszechmogący

  • Autor tematu
  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 13:47

O to chodzi?

sd22:~# netstat -ln | grep mysql
unix 2 [ ACC ] STREAM LISTENING 4229 /var/run/mysqld/mysqld.sock


  • +
  • -
  • 0

#13 disiz`

    Pomocny

  • Użytkownik

Reputacja: 8
Nowy

  • Postów:69
  • Lokalizacja:nn
Offline

Napisano 29.06.2009 13:50

tak teraz sciezke wpisz do pliku my.cnf

Poszukaj sobie my.cnf
whereis my.cnf
wpisz sciezke w nim albo podmien
socket= /var/run/mysqld/mysqld.sock
restart mysqla i mape mozesz zmienic na serwie.
  • +
  • -
  • 0

#14 bakul. <3

    Wszechmogący

  • Autor tematu
  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 13:52

Po wpisaniu whereis:

sd22:~# whereis my.cnf
my:

I nic.
  • +
  • -
  • 0

#15 disiz`

    Pomocny

  • Użytkownik

Reputacja: 8
Nowy

  • Postów:69
  • Lokalizacja:nn
Offline

Napisano 29.06.2009 13:53

Musi gdzieś być ten konfig, poszukaj w /var/run/mysqld/
albo w /etc/my.cnf

w debianie moze byc

/etc/mysql/debian.cnf
  • +
  • -
  • 0

#16 bakul. <3

    Wszechmogący

  • Autor tematu
  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 13:56

W var/run/mysqld/ są pliki mysqld.pid i mysqld.sock

Przejrzałem cały folder run, nie ma tego pliku.

@EDIT
Plik jest w folderze /etc/mysql
  • +
  • -
  • 0

#17 disiz`

    Pomocny

  • Użytkownik

Reputacja: 8
Nowy

  • Postów:69
  • Lokalizacja:nn
Offline

Napisano 29.06.2009 14:02

w nim tak jak pisałem
socket= /var/run/mysqld/mysqld.sock

  • +
  • -
  • 0

#18 bakul. <3

    Wszechmogący

  • Autor tematu
  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 14:04

Wygląda on tak:

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com... ... ables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket= /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1


#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/


  • +
  • -
  • 0

#19 disiz`

    Pomocny

  • Użytkownik

Reputacja: 8
Nowy

  • Postów:69
  • Lokalizacja:nn
Offline

Napisano 29.06.2009 14:10

Skopiuj ten konfig do /etc/mysql/my.cnf mozesz tez przy okazji do samego etc/

Pozatym:
1. Ustaw prawa i właściciela na usera "mysql" dla tego mysql.sock
2. uruchom serwer sql tak:
/etc/init.d/mysql start
  • +
  • -
  • 0

#20 bakul. <3

    Wszechmogący

  • Autor tematu
  • Użytkownik

Reputacja: 88
Zaawansowany

  • Postów:612
  • GG:
  • Imię:Przemek
  • Lokalizacja:Warszawa
Offline

Napisano 29.06.2009 14:13

Skopiowałem i uruchomiłem. A jak nadać te prawa i dać właściciela?
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych