AAC MYSQL CONNECTION ISSUES

Vapous

Excellent OT User
Joined
Jul 9, 2008
Messages
91
Reaction score
2
Location
England
Hi Guys,

Haven't made an OT in years, decided to get back into it and spent the last week mapping and creating my OT. Got it working perfect fully tested everything and the last stage was the website AAC. Decided to go for Znote as it seems to be the most used. But cannot get it to work correctly. spent 4 hours now trying to figure it out.

I am using TFS 0.4 8.6 client.

The Error i get when i try to access my website is..

Failed to connect to MySQL: (1045) Access denied for user ''@'localhost' (using password: NO)

Code:
    -- Database
    -- NOTE: sqlFile is used only by sqlite database, and sqlKeepAlive by mysql database.
    -- To disable sqlKeepAlive such as mysqlReadTimeout use 0 value.
    -- encryptionType can be plain, md5, sha1, sha256, sha512 or vahash.
    sqlType = "mysql"
    sqlHost = "127.0.0.1"
    sqlPort = 3306
    sqlUser = "otserv"
    sqlPass = "1989cj"
    sqlDatabase = "otserv"
    sqlFile = "theforgottenserver.s3db"
    sqlKeepAlive = 0
    mysqlReadTimeout = 10
    mysqlWriteTimeout = 10
    encryptionType = "plain"
here is the WWW config..

Code:
    if ($config['ServerEngine'] !== 'TFS_03') {

    // TFS DATABASE CONFIGS
    // phpmyadmin username for OT server: (DONT USE "root" if ur hosting to public.).
    $config['sqlUser'] = 'otserv';

    // phpmyadmin password for OT server:
    $config['sqlPassword'] = '1989cj';

    // The database name to connect to. (This is usually same as username).
    $config['sqlDatabase'] = 'otserv';

    // Hostname is usually localhost or 127.0.0.1.
    $config['sqlHost'] = '127.0.0.1';
    } else {
Hope this is enough information. appreciate any help and apologise in advance for any stupidity...
 

oen432

Active Member
Joined
Oct 3, 2014
Messages
123
Reaction score
77
Location
Poland
if ($config['ServerEngine'] !== 'TFS_03') here lies the problem.
TFS 0.4 = TFS_03
Make sure you have:
Line 17
$config['ServerEngine'] = 'TFS_03';
And on line 32 (change TFS_03 to OTHIRE)
if ($config['ServerEngine'] !== 'OTHIRE')
 
OP
Vapous

Vapous

Excellent OT User
Joined
Jul 9, 2008
Messages
91
Reaction score
2
Location
England
if ($config['ServerEngine'] !== 'TFS_03') here lies the problem.

Make sure you have:
Line 17
$config['ServerEngine'] = 'TFS_03';
And on line 32 (change TFS_03 to OTHIRE)
if ($config['ServerEngine'] !== 'OTHIRE')

Changed to this..

Code:
    $config['ServerEngine'] = 'TFS_03';
    // As far as I know, OTX is based on TFS_03, so make sure TFS version is configured TFS_03
    $config['CustomVersion'] = false;

    $config['site_title'] = 'Znote AAC';
    $config['site_title_context'] = 'Because open communities are good communities. :3';
    $config['site_url'] = "http://demo.znote.eu";

    // Path to server folder without / Example: C:\Users\Alvaro\Documents\GitHub\forgottenserver
    $config['server_path'] = 'C:\Users\CJ\Desktop\3777-master (1)\3777-master';

    // ------------------------ \\
    // MYSQL CONNECTION DETAILS \\
    // ------------------------ \\

    if ($config['ServerEngine'] !== 'OTHIRE') {
Still did not work.

Its strange because the server starts up fine. Just cant get on the website without this error
Failed to connect to MySQL: (1045) Access denied for user ''@'localhost' (using password: NO)
 

oen432

Active Member
Joined
Oct 3, 2014
Messages
123
Reaction score
77
Location
Poland
MySQL: (1045) Access denied for user ''@'localhost' (using password: NO)
This is wrong because before @ should be database username, no idea why it's empty.
Could you attach entire config.php?
 

oen432

Active Member
Joined
Oct 3, 2014
Messages
123
Reaction score
77
Location
Poland
But you do have that saved as config.php in your root directory?
 

oen432

Active Member
Joined
Oct 3, 2014
Messages
123
Reaction score
77
Location
Poland
Did you change anything in engine/database/connect.php?
Code:
if ($config['ServerEngine'] !== 'OTHIRE')
    $connect = new mysqli($config['sqlHost'], $config['sqlUser'], $config['sqlPassword'], $config['sqlDatabase']);
else
    $connect = new mysqli($config['sql_host'], $config['sql_user'], $config['sql_pass'], $config['sql_db']);
 
OP
Vapous

Vapous

Excellent OT User
Joined
Jul 9, 2008
Messages
91
Reaction score
2
Location
England
Did you change anything in engine/database/connect.php?
Code:
if ($config['ServerEngine'] !== 'OTHIRE')
    $connect = new mysqli($config['sqlHost'], $config['sqlUser'], $config['sqlPassword'], $config['sqlDatabase']);
else
    $connect = new mysqli($config['sql_host'], $config['sql_user'], $config['sql_pass'], $config['sql_db']);
oh wow. i just copied and pasted what you had put.. and it fixed it!! not sure what it was? but it works fine now!!!

thank you so muchhhh!!

<3
 
Top