XF 2.2 Fresh Install - An exception occurred: [mysqli_sql_exception] Access denied for user ''@'localhost' (using password: NO)

NotArchon

Member
Hey, quite a nooby question... I've setup XenForo on remote hosts before but for some reason when trying to set up a fresh install on localhost using XAMPP I receive this error:

An exception occurred: [mysqli_sql_exception] Access denied for user ''@'localhost' (using password: NO) in src\XF\Db\Mysqli\Adapter.php on line 161

I haven't done anything besides copy the upload folder to my web path and navigate to localhost/forums where I'm redirected localhost/forums/install and receive this error.

Am I supposed to manually change config.php.default to config.php?
What am I doing wrong?

Files uploaded: xenforo_2.2.1_full.zip
 

KSA

Well-known member
it looks like you don't have a database created for this installation. Navigate to localhost/phpmyadmin/ and create one. If you have already done so, then you should use the default username and that is "root" with no password.
 

NotArchon

Member
it looks like you don't have a database created for this installation. Navigate to localhost/phpmyadmin/ and create one. If you have already done so, then you should use the default username and that is "root" with no password.
Hey, thanks KSA.
I've tried that and I get another error saying something along the lines of database_xyz does not exist. I'll get the exact error and update this message. For some reason the install process seems like it's being bypassed.
Also, I thought I didn't need to change the config file which would be the place to change the username to root.
 

KSA

Well-known member
Hey, thanks KSA.
I've tried that and I get another error saying something along the lines of database_xyz does not exist. I'll get the exact error and update this message. For some reason the install process seems like it's being bypassed.
Also, I thought I didn't need to change the config file which would be the place to change the username to root.

You should not touch the config file whatsoever, just create a database lets call it xf and then navigate to the installation URL localhost/install, once there make sure to enter the database name xf in the specified field and enter the default username "root" in the specified field and you should be set to go.
 

NotArchon

Member
You should not touch the config file whatsoever, just create a database lets call it xf and then navigate to the installation URL localhost/install, once there make sure to enter the database name xf in the specified field and enter the default username "root" in the specified field and you should be set to go.
Yeah, that's my issue.
I fresh install a brand new xenforo forum then I load localhost/forums and it directs me to localhost/forums/install
BUT on that screen I get that error included in the original post. I never even get a chance to enter db info. It's instantly an error which is really weird.
 

KSA

Well-known member
Yeah, that's my issue.
I fresh install a brand new xenforo forum then I load localhost/forums and it directs me to localhost/forums/install
BUT on that screen I get that error included in the original post. I never even get a chance to enter db info. It's instantly an error which is really weird.

can you navigate to c:\xampp\htdocs\xf\internal_data and delete install-lock.php file and try again.
 

KSA

Well-known member
Okay. My config file is called config.php.default. Is this normal?

yes that file after the installation will output another config file but you could skip this step by renaming it as config.php after you edit it manually

PHP:
<?php

$config['db']['host'] = '127.0.0.1';
$config['db']['port'] = 3306;
$config['db']['username'] = 'root';
$config['db']['password'] = '';
$config['db']['dbname'] = 'xf';
$config['db']['socket'] = null;

$config['fullUnicode'] = true;

change xf to your database name if you have a different name. make sure not to delete any of the commas or semicolons.
 

NotArchon

Member
yes that file after the installation will output another config file but you could skip this step by renaming it as config.php after you edit it manually

PHP:
<?php

$config['db']['host'] = '127.0.0.1';
$config['db']['port'] = 3306;
$config['db']['username'] = 'root';
$config['db']['password'] = '';
$config['db']['dbname'] = 'xf';
$config['db']['socket'] = null;

$config['fullUnicode'] = true;

change xf to your database name if you have a different name. make sure not to delete any of the commas or semicolons.

Now I receive this error on 127.0.0.1/forums/install

1656812227503.pngKeep in mind, nothing ever loads on this page. It's always an error.
 

KSA

Well-known member
yes looks like the database is corrupted somehow. Navigate to localhost/phpmyadmin/ delete the database and recreate it again.
 

KSA

Well-known member
have you changed the database name in the config file? can you copy past your config file here if you made any changes to at all?
 

Brogan

XenForo moderator
Staff member
I've installed XF on localhost using XAMPP many times and never had any issues.

 

KSA

Well-known member
I've installed XF on localhost using XAMPP many times and never had any issues.


yeah me too tens of times but you know sometimes XAMPP acts out. I have come across this issue above a few times and I was able to get through with some tweaks here and there.
 

NotArchon

Member
I haven't tried using elasticsearch. Not sure what that is but I'll give it a shot.

have you changed the database name in the config file? can you copy past your config file here if you made any changes to at all?

PHP:
<?php

$config['db']['host'] = '127.0.0.1';
$config['db']['port'] = 3306;
$config['db']['username'] = 'root';
$config['db']['password'] = '';
$config['db']['dbname'] = 'xenforo';
$config['db']['socket'] = null;

$config['fullUnicode'] = true;
 

KSA

Well-known member
I haven't tried using elasticsearch. Not sure what that is but I'll give it a shot.



PHP:
<?php

$config['db']['host'] = '127.0.0.1';
$config['db']['port'] = 3306;
$config['db']['username'] = 'root';
$config['db']['password'] = '';
$config['db']['dbname'] = 'xenforo';
$config['db']['socket'] = null;

$config['fullUnicode'] = true;

did you rename your config.php.default file to config.php ? if not give it a try if you did and tried it and didn't work try to revert it back to config.php.default and try again.
 
Top