AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SourceBans / SourceBans++ (https://forums.alliedmods.net/forumdisplay.php?f=152)
-   -   Sourcebans Unknown MySQL Server Host 'root' (https://forums.alliedmods.net/showthread.php?t=306946)

trannygranny 04-19-2018 21:51

Sourcebans Unknown MySQL Server Host 'root'
 
I've been trying to install Sourcebans on my vps, and I've gotten to the point where I need to set up the MySQL stuff. I've gotten to here:

https://i.imgur.com/oJpjRbP.png

When I submit this, I get this peculiar error:
Code:

Fatal error: mysqli error: [2005: Unknown MySQL server host 'root' (2)] in CONNECT(root, '****', '****', !!@***.**.***.**:3306/sourcebans) in /usr/share/nginx/html/sourcebans/includes/adodb/adodb-errorhandler.inc.php on line 77
I'm not sure why this happens. In an SSH terminal, I can connect to my MySQL database just fine using 'mysql -u root -p'PASSWORD' --host=localhost, so I have no idea why this is happening. If anyone can point me in the right direction, I would appreciate it. It may be worth it to note that in my SSH terminal, when logged into root, rather than displaying 'root@localhost', it displays 'root@ns543799' at the beginning of each line. Not sure if this makes a difference or not.

As well, I made a test PHP script to connect to my database, and it worked fine as so:

Code:

<?php
    $pConnection = new mysqli( "localhost", "root", "********", "sourcebans" );
    if( $pConnection->connect_error )
                die("Connection error ".$pConnection->connect_error );
?>

The connection error is not echoed.

DarkDeviL 04-20-2018 03:28

Re: Sourcebans Unknown MySQL Server Host 'root'
 
Quote:

Originally Posted by trannygranny (Post 2588544)
When I submit this, I get this peculiar error:
Code:

Fatal error: mysqli error: [2005: Unknown MySQL server host 'root' (2)] in CONNECT(root, '****', '****', !!@***.**.***.**:3306/sourcebans) in /usr/share/nginx/html/sourcebans/includes/adodb/adodb-errorhandler.inc.php on line 77

This error means that you entered "root" as "Server Hostname", and that it obviously don't where "root" is supposed to point to.

Enter the IP address (or hostname) of the server providing the SQL service in that hostname.

Ask the hosting provider, providing you with the SQL server for that information. If you are having a SQL server on the same machine as your game servers (and/or SourceBans web panel), as your text indicates, you could try "127.0.0.1" or "localhost" (both pointing to the machine where the traffic originates from).

trannygranny 04-20-2018 09:52

Re: Sourcebans Unknown MySQL Server Host 'root'
 
Quote:

Originally Posted by arne1288 (Post 2588568)
This error means that you entered "root" as "Server Hostname", and that it obviously don't where "root" is supposed to point to.

Enter the IP address (or hostname) of the server providing the SQL service in that hostname.

I was entering the IP address of where I'm trying to host sourcebans on, and when I try localhost I get the same error:

https://i.imgur.com/vTxx7Hl.png

Code:

Fatal error: mysqli error: [2005: Unknown MySQL server host 'root' (2)] in CONNECT(root, '****', '****', !!@localhost:3306/sourcebans) in /usr/share/nginx/html/sourcebans/includes/adodb/adodb-errorhandler.inc.php on line 77
Warning: mysqli_real_connect(): (HY000/2005): Unknown MySQL server host 'root' (2) in /usr/share/nginx/html/sourcebans/includes/adodb/drivers/adodb-mysqli.inc.php on line 113

I'm doing it the same way everyone else is but for some reason I'm getting an error. I don't know why it's saying it's using the username as the host.
Also, I tried the sourcebans 2.0 alpha version, and it works fine with MySQL.


All times are GMT -4. The time now is 17:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.