Помогите Mysql на xauth

Дмитрий_Miner

Активный участник
Пользователь
Баллы
63
Ник в Minecraft
Danalo23
Помогите пожалуйста :
Создал тестовый сервер кинул xAuth сам пользуюсь AuthMe
Пишет :
Код:
[SEVERE] [xAuth] Could not connect to database! [DBMS = MYSQL]
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2334)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2371)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at com.cypherx.xauth.database.Database.connect(Database.java:36)
    at com.cypherx.xauth.xAuth.onEnable(xAuth.java:91)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:230)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:989)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:190)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:173)
    at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:443)
    at org.bukkit.Bukkit.reload(Bukkit.java:188)
    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:22)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:385)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:381)
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:573)
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:550)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
Caused by: java.net.UnknownHostException: mysql.hostinger.ru
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
    at java.net.InetAddress.getAddressFromNameService(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:244)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292)
    ... 31 more
 
Установил AuthMe

Конфиг AuthMe:
Код:
############################################################
# +------------------------------------------------------+ #
# |                  DataController                      | #
# +------------------------------------------------------+ #
############################################################
DataController:
    # This Cache saves registration details like username and password
    # Change it to false, if you want edit the datasource under runtime
    # Otherwise let it to true!
    CacheEnabled: true
 
    # Possible datasources are 'flatfile' or 'mysql'
    Datasource: mysql
 
############################################################
# +------------------------------------------------------+ #
# |                      Misc                          | #
# +------------------------------------------------------+ #
############################################################
Misc:
    # Set it to false, if you want let the player decide, if he should register or not
    ForceRegistration: true
 
    # If it's enabled, it will kick non-registered players before they could join
    # Make sure to edit the Kick.NotRegistered message in message file!
    KickNonRegistered: false
 
    # What has to be done, if a player typed a wrong password?
    # Kick him (true) or only warn him with a simple chat message (false)
    KickOnWrongPassword: true
 
    # Kick a non-loggedin player after he has reached a certain timeout (in seconds)
    # To disable this, set it to 0
    LoginTimeout: 90
 
    # The intervall between Alert.Login and Alert.Registration messages (in seconds)
    AlertInterval: 5
 
    # What should we allow unregistered players?
    AllowNonRegistered:
        Chat: false
        # Following commands are allowed to use
        # Be warned: Additionally every subcommand gets allowed, e.g. '/uptime today'
        Commands:
        - uptime
        WalkAroundSpawn:
            Enabled: false
            Radius: 20
 
    # What should we allow players, that are not logged in?
    AllowNonLoggedIn:
        # Following commands are allowed to use (and every subcommand!)
        # Be warned: Additionally every subcommand gets allowed, e.g. '/uptime today'
        Commands:
        - uptime
 
    # Following players get unrestricted access without the force to log in
    # Use this function, if you use plugins, that create bots (NPCs)!
    AllowPlayerUnrestrictedAccess:
    - Bot01
 
    # Algorithm hash (MD5, SHA256).
    Hash: SHA256
 
############################################################
# +------------------------------------------------------+ #
# |              Playername Restrictions                | #
# +------------------------------------------------------+ #
############################################################
PlayerNameRestriction:
    # The name of a player should have the following maximum and minimum length
    PlayerNameMaxLength: 20
    PlayerNameMinLength: 3
 
    # The characters in the name can be restricted by RegEx
    # For more informatiom about RegEx visit
    # http://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes
    PlayerNameRegex: '[a-zA-Z0-9_?]*'
 
############################################################
# +------------------------------------------------------+ #
# |                  Login Sessions                    | #
# +------------------------------------------------------+ #
############################################################
LoginSessions:
    # This function automatically logs players in, if they were already logged
    # in before their last disconnect
    Enabled: false
 
    # Maximum timeout between last logout and new connection (in seconds)
    MaximalTimePeriod: 5
 
    # Be warned: Only disable this, if you know what you are doing!
    # Disabling this makes AuthMe not comparing old and new IPs and maybe
    # grants access to name spoofers (in case you are in offline-mode)
    IPCheckEnabled: true
 
############################################################
# +------------------------------------------------------+ #
# |                    Commands                        | #
# +------------------------------------------------------+ #
############################################################
Commands:
    Users:
        ChangePasswordEnabled: true
        RegisterEnabled: true
        UnregisterEnabled: true
        LoginEnabled: true
        LogoutEnabled: true
    Ops:
        ReloadAuthsEnabled: true
        ResetAuthEnabled: true
 
############################################################
# +------------------------------------------------------+ #
# |                  MySQL Settings                      | #
# +------------------------------------------------------+ #
############################################################
MySQL:
    # Connection details
    Connection:
        Host: mysql.hostinger.ru
        Port: 3306
        Database: u808862325_mc
        Username: u808862325_admin
        Password: **********
 
    # Settings for a custom user table
    # Do not change this, if you don't have any scripts reqiring this
    Custom:
        TableName: accounts
        ColumnUsername: playername
        ColumnPassword: password
        # Custom information, that a player has to type on /register command
        # This function is only available for MySQL as datasource!
        # Make sure that you have a column with the right name in your database!
        # The information gets checked, if it complies to the given RegEx string
        # If the check was successfull, the information get stored in the respective column
        # A line must be built up like following:
        #  columnname: 'regexstring'
        # For good RegEx strings visit http://regexlib.com
        # If you are still unsure, check the given example below (email)
        RegistrationInfo:
#            email: '^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$'
Конект :
Код:
<?php
if(!defined('INCLUDE_CHECK')) die('У вас нет прав на выполнение данного файла!');
 
// Конфигурация подключения к базе данных
$db_host        = 'mysql.hostinger.ru'; // Ip-адрес базы данных
$db_port        =  3306; // Порт базы данных
$db_user        = 'u808862325_admin'; // Пользователь базы данных
$db_pass        = '**********'; // Пароль базы данных
 
// Конфигурация базы данных для плагинов AuthMe, xAuth, CAuth
/*
$db_database - имя базы данных, значение по умолчанию для плагинов:
AuthMe = authme, xAuth = отсутствует (указывается вручную), CAuth = cauth
*/
$db_database    = 'u808862325_mc';
 
/*
$db_table - таблица базы данных, значение по умолчанию для плагинов:
AuthMe = authme, xAuth = accounts, CAuth = users
*/
$db_table      = 'authme';
 
/*
$db_columnId - уникальный идентификатор, значение по умолчанию для плагинов:
AuthMe = id, xAuth = id, CAuth = id
*/
$db_columnId  = 'id';
 
/*
$db_columnUser - колонка логина, значение по умолчанию для плагинов:
AuthMe = username, xAuth = playername, CAuth = login
*/
$db_columnUser  = 'username';
 
/*
$db_columnPass - колонка пароля, значение по умолчанию для плагинов:
AuthMe = password, xAuth = password, CAuth = password
*/
$db_columnPass  = 'password';
 
/*
$db_columnEmail - колонка email'a
*/
$db_columnEmail  = 'email';
 
/*
$db_columnLastLogl - колонка даты последнего входа
*/
$db_columnLastLog  = 'lastlogindate';
 
/*
$db_columnRegDate - колонка даты регистрации
*/
$db_columnRegDate  = 'registerdate';
 
/*
$db_columnSesId - колонка id сессии
*/
$db_columnSesId = 'session';
 
/*
$db_columnServer - колонка id сервера
*/
$db_columnServer = 'server';
 
/*
Настройки таблицы для защиты от подбора паролей
*/
$db_ErrorLogtable = 'errorlogin';
$db_Ipcolumn = 'ip';
$db_Datecolumn = 'date';
$db_Numcolumn = 'num';
 
/*
$db_GameDatatable - имя базы данных с информацией о версиях
*/
$db_GameDatatable = 'data';
 
/*
НЕ МЕНЯТЬ
*/
$db_Propertycolumn = 'property';
$db_Valuecolumn = 'value';
 
$link = @mysql_connect($db_host.':'.$db_port,$db_user,$db_pass) or die('Невозможно установить соединение с базой данных!');
 
mysql_select_db($db_database,$link);
mysql_query("SET names UTF8");
?>

*Вместо звёздочек пароль ( написал для вас )
 
@Дмитрий_Miner,

/* $db_columnId - уникальный идентификатор, значение по умолчанию для плагинов: AuthMe = id, xAuth = id, CAuth = id */ $db_columnId = 'id';
Этот параметр не поправлен вроде
 
$db_columnId = 'xAuth ';
если у тебя именно он
 
Назад
Верх Низ