• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

1&1: Denied access to the database

soloarquitectura

Well-known member
#1
The installer says:
Your server meets all of XenForo requirements and you're now ready to begin installation.

Knowing that the MySQL port for 1&1 is: /tmp/mysql5.sock
I put it, but the installer tells me:

The following error occurred while connecting to the database:
Access denied for user: 'dboXXX@localhost' (Using password: YES)
This indicates that your configuration information is not correct. Please check the values you have entered. If you are unsure what values are correct or how to proceed, please contact your host for help. These values are specific to your server.

I edited the config.php manually:
$config['db']['host'] = 'localhost';
$config['db']['port'] = '/tmp/mysql5.sock';
$config['db']['username'] = 'dboXX';
$config['db']['password'] = 'XXX';
$config['db']['dbname'] = 'dbXXX';

This configuration works well with vBulletin 4:
$config['Database']['dbname'] = 'dbXXX';
$config['MasterServer']['servername'] = 'localhost';
$config['MasterServer']['port'] = '/tmp/mysql5.sock';
$config['MasterServer']['username'] = 'dboXXX';
$config['MasterServer']['password'] = 'XXX';

But still not working :(

Nevertheless, I added php_value mysql.default_socket "/tmp/mysql5.sock" to .htaccess, as shown here (although is not necessary for vBulletin 4):
http://www.vbulletin.com/forum/showthread.php?301047-Database-connection-error/page2

But still not working, so you have to communicate because it is almost certain that the problem is in the interpretation of the port.

Please do you can fix so we can test the beta?
 
#2
Confirmed! ;)

Mike, you're really great!

No need to edit Mysqli.php anymore!!! :D

This is config.php that works fine with 1&1 Managed Server:

<?php

ini_set('mysqli.default_socket', '/tmp/mysql5.sock');

$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
$config['db']['username'] = 'db0XXXXXXXXX';
$config['db']['password'] = 'XXXXXXXXXXX';
$config['db']['dbname'] = 'dbXXXXXXXXX';
(...)
 

Mike

XenForo developer
Staff member
#7
I don't know whether they document this, but using 127.0.0.1 should get it to use a TCP connection, getting around the socket issue anyway. That said, it looks like they're running 2 MySQL servers and who knows the port of the correct one...
 
#9
I don't know whether they document this, but using 127.0.0.1 should get it to use a TCP connection, getting around the socket issue anyway. That said, it looks like they're running 2 MySQL servers and who knows the port of the correct one...
port is 3316 is my case. I think it's documented at 1and1, or you can call their server team and ask.
 
#10
I recently had a huge issue with this trying to install a support site (Kayako 4). Kept getting errors and their engineers just told me to contact my hosting provider. After [finally] convincing them that it was a problem with their scripts - and not my database credentials - they patched their code to make it compliant with sockets. That allowed me to install it, but then I had a problem again because their import routines were not written for sockets either.

Anyway I know from personal experience what a headache this issue can be. If the Xenforo dev team isn't ready to address it, the least they could do is offer a link to this article whenever that error is presented to future users.
 

Slavik

XenForo moderator
Staff member
#12
Is this just on the 1and1 standard hosting plans? I have never had any issues with their VPS or dedi servers.
 
#13
If 1&1 have so many issues, have you not considered changing hosts?


Use of sockets is not so unconventional. I blame the web app developers - and Zend - not the host. They just need to design their software to optionally allow sockets. As you can see above, it's only takes a couple lines of code to do the trick.

It's much easier and cheaper to patch a php script than to move my domains, emails, apps and databases somewhere else. But I haven't had many problems with 1and1 at all. Some people hate them, but I've been with them for around 6 years or more. I run x-cart and supporting apps like Kayako and a few installations of WordPress. Was running IPB; but just installed XenForo. Generally it's been a very good experience. I'm on a dedicated server. No real complaints about performance and up-time. I recommend them.
 
#14
@Brogan

btw, I discovered XenForo over at Kayako. That they are running it for their forums is very good exposure for you. Maybe you can get the x-cart people on board too. Give it to them for free. hell, PAY them to run it if you have to. They have a lot of customers.
 
#18
The default port for MySQL installation is 3306 and not 3316.
Of course, but:
$config['db']['host'] = '127.0.0.1';
$config['db']['port'] = '3306';
(...)

It does not work.
The only solution, as already noted above, is to edit Mysqli.php.

It would be a pleasant surprise to find a better solution in XenForo 1.1.