vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Database error on Ubuntu (https://vborg.vbsupport.ru/showthread.php?t=307368)

Exeter 01-23-2014 03:28 AM

Database error on Ubuntu
 
I moved my board top an ubuntu vm to test a few features. Unfortunately vb fails to create a mysql connection.

mysqli_real_connect(): (HY000/2003): Can't connect to MySQL server on '127.0.0.1' (111)
/var/www/wwwroot/includes/class_core.php on line 1358

The username, password, and host appear to be correct. Connecting to the DB from a non-vb based PHP script works fine (using the same db users).

What could be causing this? Could I be missing packages or an environment configuration?

Thanks for your help

Brandon Sheley 01-23-2014 05:14 AM

Make sure your config.php file is setup correcty.
It's not connecting to mysql.
What did you change inside that file?

This should help you troubleshoot
http://www.vbulletin.com/docs/html/cantconnect

Exeter 01-23-2014 06:28 AM

The changes in the config are the obvious things. I traced the values the script uses on the line right before the error. Username, password, port, and db name are all correct.

I can connect just fine from a custom script run on the same server. All the connection tests I ran passed just fine. MySql is listening and the firewall is off.

RichieBoy67 01-23-2014 04:03 PM

What do your mysql error logs have?

Exeter 01-23-2014 10:47 PM

The mysql error log is empty.
As is the php log, because vb catches the error.

RichieBoy67 01-23-2014 11:14 PM

I am talking about the logs in your servers var/log directory. They have nothing to do with the Vbulletin logs and they will show more details especially if you are having a server or my.cnf configuration issue.

Exeter 01-24-2014 07:32 AM

Yes, those logs are empty.

--------------- Added [DATE]1390554864[/DATE] at [TIME]1390554864[/TIME] ---------------

Turns out the issue was the hostname.

127.0.0.1 (did not work)
localhost (works)

I don't know why yet.

Thanks everyone for your help.

RichieBoy67 01-24-2014 02:04 PM

I was just going to post to check your config again. If your server log for mysql is empty then the problem lies in the config. it is tough to troubleshoot though without seeing what you have set there in the first place. Plus what confused me was when you said you used another script outside of Vbulletin. I just assumed it was using the same settings.

Oh well, all is well that ends well. Glad you have it figured out.


All times are GMT. The time now is 11:59 AM.

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.01031 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete