Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: EK.IceFlake on Sep 05, 2015, 07:27 AM

Title: Mysql not connecting
Post by: EK.IceFlake on Sep 05, 2015, 07:27 AM
Hi guys
I tried connecting a MySQL server to my script
mysql_connect("127.0.0.1", "systemroot", "(alphanumeric, censored, 10 digits, not in brackets)", "estatecity", 7732);Then I get this error:
[SCRIPT]  System initializing
[SCRIPT]  Please wait...

[SCRIPT]  Loading SQL database
[SCRIPT]  Connecting...

AN ERROR HAS OCCURED [Error in 'mysql_connect': Connection failed. Make sure connection details are correct.]

CALLSTACK
*FUNCTION [Init()] main.nut  line [20]
*FUNCTION [onScriptLoad()] main.nut  line [12]

LOCALS
[this] CLASS
[this] TABLE
[WARNING] onScriptLoad failed to execute -- check the console for more details.

Help appreciated
Title: Re: Mysql not connecting
Post by: KAKAN on Sep 05, 2015, 08:23 AM
Maybe the hostname u gave is wrong...
Title: Re: Mysql not connecting
Post by: EK.IceFlake on Sep 05, 2015, 08:44 AM
No its not. 127.0.0.1 = localhost
Btw my MySQL port is 7732
Title: Re: Mysql not connecting
Post by: . on Sep 05, 2015, 08:50 AM
Well, considering you are on localhost you could share the code and even credentials. As you know, more details results in faster fixing.
Title: Re: Mysql not connecting
Post by: KAKAN on Sep 05, 2015, 09:21 AM
I want to know the syntax, the same problem is happening with me when I was using Apache to use MySQL, so can anyone give me the SYNTAX of mysql_connect?
Title: Re: Mysql not connecting
Post by: EK.IceFlake on Sep 05, 2015, 09:22 AM
mysql_connect(string host, string user, string pass, string db, [int port]);
Title: Re: Mysql not connecting
Post by: EK.IceFlake on Sep 05, 2015, 09:24 AM
Quote from: S.L.C on Sep 05, 2015, 08:50 AMWell, considering you are on localhost you could share the code and even credentials. As you know, more details results in faster fixing.
I shared everything except for password. Anyways I need to forward 7732, because the only reason I am using MySQL is to have a UCP. I'm not going to host my web server myself I cant set it up under any circumstances whatsoever I tried many times but php never worked. So I decided that I'm not hosting any webservers myself so I will use a 000webhost server
Title: Re: Mysql not connecting
Post by: EK.IceFlake on Sep 05, 2015, 09:30 AM
Never mind fixed it by running it as root (root user, I'm not using Linux)
Title: Re: Mysql not connecting
Post by: Wolf on Sep 05, 2015, 03:30 PM
crystelblue i need to script my server can you script my server this is not an order this is a request from your brother
Title: Re: Mysql not connecting
Post by: Thijn on Sep 05, 2015, 06:55 PM
Quote from: hammad on Sep 05, 2015, 03:30 PMcrystelblue i need to script my server can you script my server this is not an order this is a request from your brother
You're not his brother, and this isn't the place to ask. This isn't your topic.