Raised This Month: $246 Target: $400
 61% 

Notices

Sourcebans Unknown MySQL Server Host 'root'


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
trannygranny
Junior Member
Join Date: Jul 2017
Old 04-19-2018 , 21:51   Sourcebans Unknown MySQL Server Host 'root'
Reply With Quote #1

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:



When I submit this, I get this peculiar error:
Code:
Fatal error: mysqli error: [2005: Unknown MySQL server host 'root' (2)] in CONNECT(root, '****', '****', [email protected]***.**.***.**: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 '[email protected]', it displays '[email protected]' 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.

Last edited by trannygranny; 04-19-2018 at 21:56.
trannygranny is offline
arne1288
SourceMod Moderator
Join Date: Apr 2012
Old 04-20-2018 , 03:28   Re: Sourcebans Unknown MySQL Server Host 'root'
Reply With Quote #2

Quote:
Originally Posted by trannygranny View Post
When I submit this, I get this peculiar error:
Code:
Fatal error: mysqli error: [2005: Unknown MySQL server host 'root' (2)] in CONNECT(root, '****', '****', [email protected]***.**.***.**: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).
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread]
arne1288 is offline
trannygranny
Junior Member
Join Date: Jul 2017
Old 04-20-2018 , 09:52   Re: Sourcebans Unknown MySQL Server Host 'root'
Reply With Quote #3

Quote:
Originally Posted by arne1288 View Post
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:



Code:
Fatal error: mysqli error: [2005: Unknown MySQL server host 'root' (2)] in CONNECT(root, '****', '****', [email protected]: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.

Last edited by trannygranny; 04-20-2018 at 09:55.
trannygranny is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:34.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode