Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Gängelbert

#1
Tutorials / Re: [Tutorial] Setting up MYSQL.
Jul 11, 2024, 05:39 PM
Hey Guys,

I downloaded the Blank Script and followed the steps from the starting post. However, I always get the following error message:

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

CALLSTACK
*FUNCTION [onScriptLoad()] ./scripts/base/freeroam.nut line [10]
*FUNCTION [acall()] NATIVE line [-1]
*FUNCTION [scripts_handle()] ./scripts/scripts.nut line [54]
*FUNCTION [onScriptLoad()] ./scripts/scripts.nut line [79]

LOCALS
[this] TABLE
[f] CLOSURE
[script_context] TABLE
[script_name] "base/freeroam.nut"
[script] ARRAY
[@INDEX@] 0
[a] ARRAY
[final_result] 1
[vargv] ARRAY
[name] "onScriptLoad"
[this] TABLE
[this] TABLE
[SCRIPT]  Error in 'mysql_connect': Connection failed. Make sure connection details are correct.
[SCRIPT]  (table : 0x000001AA8E404E00)

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

CALLSTACK
*FUNCTION [scripts_handle()] ./scripts/scripts.nut line [62]
*FUNCTION [onScriptLoad()] ./scripts/scripts.nut line [79]

LOCALS
[exception] "Error in 'mysql_connect': Connection failed. Make sure connection details are correct."
[f] CLOSURE
[script_context] TABLE
[script_name] "base/freeroam.nut"
[script] ARRAY
[@INDEX@] 0
[a] ARRAY
[final_result] 1
[vargv] ARRAY
[name] "onScriptLoad"
[this] TABLE
[this] TABLE
[WARNING] onScriptLoad failed to execute -- check the console for more details.

The error message indicates that the login details are incorrect. However, I can't find any errors. The code in freeroam.nut looks like this:

mysql_hostname <- "localhost";
mysql_database <- "testdatabase";
mysql_username <- "root";
mysql_password <- " ";



function onScriptLoad() {




   mysqlDB <- mysql_connect( mysql_hostname, mysql_username, mysql_password, mysql_database);
   if( mysqlDB ) print( "[SERVER] Connection to mySQL database successful." );
   else print( "[SERVER] Connection to mySQL failed." );

.....

.....

.....


The user "Root" does not have a password. When I assign a password via Phpmyadmin, Phpmyadmin gives me an error message. I was able to fix this so far, but then I was no longer able to log in to Phpmyadmin...

As a test, I also created a new user in Phpmyadmin, but without success. The login details always seem to be incorrect...

I'm new to Vice City Multiplayer and would like to practice scripting. That's why I'm grateful for any help.