Go Back   vb.org Archive > Community Discussions > Forum and Server Management
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2009, 11:33 AM
Amiga Harrison Amiga Harrison is offline
 
Join Date: Nov 2006
Location: UK
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vB wont connect to database on managed 1and1 server.

I've been trying to move my forum from a shared hosting account with Bluehost, to a dedicated managed server with 1and1.

I've so far backed up the forum's file structure and moved that over to the new server. Backed up the database via ssh, created a new database on the new server, and imported the backup successfully.

However after editing the config.php file and entering the new database's details, and then trying to connect to the forum on the new server I get the following error:

Quote:
mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/tmp/mysql5.sock:3316' (2)
Some information about 1and1 setup:

1and1 upgraded their managed dedicated servers a couple of weeks ago to support mysql 5. Before this they only allowed mysql 4. However to use mysql 5 on a 1and 1 server you need to use a different socket and port number compared to the default settings normally used by mysql.

For my vB database the connection settings are as follows:

Database name dbxxxxxxxxx
Host name localhost:/tmp/mysql5.sock
Port 3316
User name dboxxxxxxxxx
Password xxxxxxxx
Socket /tmp/mysql5.sock

I therefore have been trying to connect to the database using the following settings in the config.php file:

Quote:
$config['MasterServer']['servername'] = 'localhost:/tmp/mysql5.sock';
$config['MasterServer']['port'] = '3316';
But am getting the error I posted above.

On doing some searching I found a thread on the German vB.org forum that is discussing about this and using mysql 5 with vB on a 1and1 server. However I don't know any German and the web translaters didn't do a very good job of converting the posts. The German thread can be found at:

http://www.vbulletin-germany.org/sho...p?t=272&page=9

In a couple of the posts it mentions replacing the port entry in config.php with the socket location. I tried that but it didn't work. And in a couple of others it mentioned editing the class_core.php file and adding the socket information into that. But I'm not sure at this point as I did try the example given in the thread but it didn't do anything either.

Can anyone help me solve this problem? I've tried to contact 1and1's support, but they still haven't got back to me and the forum has now been down for nearly 2 weeks already. I was really hoping to get it back online this week.

Oh, and finally. To test it wasn't an issue with my backup of the forum, I used the backup to set the forum up on another server and it restored and worked perfectly, connecting to the new database and working as it should. So it is definitely a problem unique to how 1and1 have set up the way their dedicated managed servers use mysql 5.

I've now exhausted what I can think to do and need some help.

I have posted about this on the main vB.com forums, but they haven't been able to help me yet. That post can be found at http://www.vbulletin.com/forum/showthread.php?p=1701307
Reply With Quote
  #2  
Old 02-26-2009, 12:12 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try:

PHP Code:
$config['MasterServer']['servername'] = 'localhost';
$config['MasterServer']['port'] = '/tmp/mysql5.sock'
Reply With Quote
  #3  
Old 02-26-2009, 12:17 PM
Amiga Harrison Amiga Harrison is offline
 
Join Date: Nov 2006
Location: UK
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When trying that I get the following error:

Quote:
mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'dboxxxxxxxx'@'localhost' (using password: YES)
/homepages/x/dxxxxxxxx/htdocs/forum/includes/class_core.php on line 311
Worth noting though, is that I also get this error in ssh if I try to log into mysql without putting "-S /tmp/mysql5.sock" in the mysql shell command. Does this therefore indicate that vB cannot find the socket like this? And is therefore ignoring the entry in the port setting? I also noticed when looking through the class_core.php file that port 3306 is hard coded into 4 different places in the code.
Reply With Quote
  #4  
Old 02-26-2009, 01:00 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you please verify with your host that the MySQL user & password are correct. The error message you get now indicates the wrong user or password, or the user does not have permision to the database.
Reply With Quote
  #5  
Old 02-26-2009, 01:04 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can also give the following a try:

PHP Code:
$config['MasterServer']['servername'] = '127.0.0.1';
$config['MasterServer']['port'] = '3316'
Edit: Are you using MySQL or MySQLi?
Reply With Quote
  #6  
Old 02-26-2009, 01:55 PM
Amiga Harrison Amiga Harrison is offline
 
Join Date: Nov 2006
Location: UK
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
Can you please verify with your host that the MySQL user & password are correct. The error message you get now indicates the wrong user or password, or the user does not have permision to the database.
Yes, the user and password are correct.

I get the same error when trying to connect to a database via ssh if I don't include the socket. But if I do include the socket then it connects properly.

Quote:
Originally Posted by Marco van Herwaarden View Post
You can also give the following a try:

PHP Code:
$config['MasterServer']['servername'] = '127.0.0.1';
$config['MasterServer']['port'] = '3316'
Edit: Are you using MySQL or MySQLi?
I'm using MySQL.

On trying those details I get the following error:

Quote:
mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111
/homepages/x/dxxxxxxxxx/htdocs/forum/includes/class_core.php on line 311
Reply With Quote
  #7  
Old 02-26-2009, 02:04 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please open a support ticket regarding this. Make sure to include all needed info including access to AdminCP, FTP (and if possible SSH) & phpMyAdmin. Please use "FAO: Marco" as title for the ticket and i will have a look. But i will probably not respond until tomorrow (if you don't want to wait until tomorrow, you can use any other title and a co-worker will have a look, but will probably start with default solutions).
Reply With Quote
  #8  
Old 02-26-2009, 02:18 PM
Amiga Harrison Amiga Harrison is offline
 
Join Date: Nov 2006
Location: UK
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK thanks. I will open a ticket now.
Reply With Quote
  #9  
Old 02-26-2009, 05:14 PM
BSMedia BSMedia is offline
 
Join Date: Feb 2009
Posts: 454
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've never seen a host name formed like that, I'd contact 1&1 especially since its managed and ask about the settings they gave you.
Reply With Quote
  #10  
Old 02-26-2009, 10:58 PM
Amiga Harrison Amiga Harrison is offline
 
Join Date: Nov 2006
Location: UK
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've finally managed to fix the database connection issue. 1&1's support finally got back to me with some suggestions and for once they worked.

For anyone else who might be using a 1&1 managed dedicated server, this is what you need to do.

1, From the 1and1 Control Panel - Go to the server Administration section and make sure PHP is running as a module.

2, Create a .htaccess file and put the following line into it.

php_value mysql.default_socket "/tmp/mysql5.sock"

And put this .htaccess file into the root of the forum directory.

3, Enter the following settings into the vB config.php file.

$config['MasterServer']['servername'] = 'localhost';
$config['MasterServer']['port'] = '/tmp/mysql5.sock';

And this fixed my problem.

However I do now have another problem. When I try to log into the forum I get a server 500 error, and when I try to log into the admincp it just throws me back out to the admin login screen. Any ideas what could be causing that problem?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:26 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07966 seconds
  • Memory Usage 2,275KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete