Jeffery P Gillivan's picture

I installed mediawiki from a turnkey iso to a virtual machine.  I saw no errors during the install but when I go to the http or https page to access the wikimedia i get:

 

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Can't contact the database server: Access denied for user 'mediawiki'@'localhost' (using password: YES) (localhost))


 
 
 
I can acces all the web admin pages so I know apache is working. What do I need to do to get mediawiki working?
 
Thanks,
Forum: 
Jeremy Davis's picture

When you install TKL you need to go through the first boot init scripts - which as the name suggests, run on first boot (after install) and initialise the system. It includes stuff like MySQL passwords etc. If you haven't done that it won't work.

Jeffery P Gillivan's picture

Yes,  I did run through the first boot scripts and set the account passwords.  

Jeremy Davis's picture

I haven't actually tested the ISO but i have just tested the OVZ template and the AMI (via the Hub) - both v13.0 64 bit. It all works as it should for me... All I did was install and complete the first boot stuff and it just works...

So first thing I'd probably try is checking that your ISO matches the hash...

Jeffery P Gillivan's picture

The MD5 Hash does match.  I am trying a fresh install.  When I selected the partationing method I choose "Guided use entire disk" instead of "Guided use entire disk and setup LVM".  Could this be the issue?

Jeremy Davis's picture

It should function fine whether you use LVM or not. And for interest I installed the updates during setup (although that shouldn't matter either). Seems like a strange one... 

If you haven't already trashed the old one out of interest it could be worth seeing if MySQL is running.

service mysql status

And/or try connecting to phpMyAdmin (https://<ip>:12322) using the root account (and the MySQL root password you defined on firstboot).

Jeffery P Gillivan's picture

  ↵

root@mediawiki ~# service mysql status
[info] /usr/bin/mysqladmin  Ver 8.42 Distrib 5.5.31, for debian-linux-gnu on x86_64
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.                                                                                                                       
                                                                                                                                                                                                   
Oracle is a registered trademark of Oracle Corporation and/or its                                                                                                                                  
affiliates. Other names may be trademarks of their respective                                                                                                                                      
owners.                                                                                                                                                                                            
                                                                                                                                                                                                   
Server version          5.5.31-0+wheezy1                                                                                                                                                           
Protocol version        10                                                                                                                                                                         
Connection              Localhost via UNIX socket                                                                                                                                                  
UNIX socket             /var/run/mysqld/mysqld.sock                                                                                                                                                
Uptime:                 59 min 45 sec                                                                                                                                                              
                                                                                                                                                                                                   
Threads: 1  Questions: 11  Slow queries: 0  Opens: 34  Flush tables: 1  Open tables: 27  Queries per second avg: 0.003.
 
 
(FYI, I did reinstall bevfore running this command, but still no change)
Jeremy Davis's picture

Obviously MySQL not running is not hte issue... From your original post it seems that the issue is that MediaWiki can't connect to MySQL and I thought that maybe MySQL wasn't running...

This is all very strange... Out of interest which ISO are you using? v13.0? 64bit? Which VM environment are you using? What host OS? I will download the ISO and see if I can recreate your issue...

Jeffery P Gillivan's picture

Is the default URL = http://<serverIP>  or https://<serverIP>   ?

or is it something like http://<serverIP>/home.html ?

Jeremy Davis's picture

So for me (on my local OVZ VM) its: http://192.168.1.126/ but that then auto redirects to http://192.168.1.126/index.php/Main_Page 

https works also.... And FWIW http://192.168.1.126/index.php also redirects to http://192.168.1.126/index.php/Main_Page

Jeffery P Gillivan's picture

I tried those urls and no dice.

 

What is throwing me is this portion of the errror:

Access denied for user 'mediawiki'@'localhost' (using password: YES) (localhost)

is your mediawiki user configured as host=localhost and password=yes  in phpmyadmin?

 

Jeremy Davis's picture

(Or perhaps missing...) What should be happening during firstboot is that the init scripts should be generating a random password for the MediaWiki DB and then adding that password to the MediaWiki config (so MediaWiki can connect to the DB). And it looks like for some reason that process is not working properly...

There is a way that you can rerun the script that does this but I don't have my server handy ATM and don't want to lead you astray by guessing.

What you could try is going into phpMyAdmin and manually (re)set the password for the MediaWiki user. Then also insert this password into the MediaWiki config file (IIRC it should be /var/www/mediawiki/localsettings.php). It may also pay to double check the MySQL settings.

For reference have a look at the MediaWiki documentation here and here.

Jeffery P Gillivan's picture

The version I downloaded was the only one in the list for ISO, which appears to be 64bit and version 13.0 based on the file name.  I have this installed on a 64bit 2008r2 hyper-v host

Jeremy Davis's picture

As I don't have access to a Hyper-V host (not that I'd want too! :p) But even though you have resolved your issue, it still shouldn't be that way... So I'll download the ISO and test when I get a chance.

Chad Hedstrom's picture

Also having the same issue with Windows Hyper-V Server 2012 R2 installing from the ISO.

I am getting the error (Can't contact the database server: Access denied for user 'mediawiki'@'localhost' (using password: YES) (localhost))

Using Stable version: 13.0

Judging from the other comments here it seems that this issue is specific to the ISO version

Jeremy Davis's picture

I just downloaded the 64 bit ISO and installed to a VM (KVM) and all works as it should... So seems more likely that it's a Hyper-V issue? Strange that it seems to be just the MediaWiki DB user password setting that fails... As I said previously I don't have an instance of Hyper-V available so can't really go any further trying to debug what the issue may be...

Chad Hedstrom's picture

I uninstalled and reinstalled and it seems to be working this time around. The only difference was the for the failed install, I chose the "use the LVM" option and chose the default of 90% of the disk, while on the successful install I chose the "use whole disk" option.

Jeremy Davis's picture

Ok so maybe it's some sort of incompatibility between the Hyper-V vHDD and LVM? (I used LVM from the ISO install and it worked fine). Still seems strange that there weren't more issues...

Jeffery P Gillivan's picture

The wikiuser password thing did the trick.  I examined the php file and copied the password in the file and set it in phpmyadmin. Thank You!

You seem pretty knowledgeable so I have a few quick questions.

1) can "templates" be created for new pages (I don't mean CSS stuff)

2) do you know of a resource for a crash course in mediawiki?

3) can the entire web site be password protected from the get go, meaning that when a use lands on the default site they have to enter credientials?

 

The goal is to try and use mediawiki for network documentation.  Since you are in the administration arena, what do you use for network documentation?

 

Thanks in advance.

 

 

Jeremy Davis's picture

But I still don't know why you had this issue. It should just work OOTB (as my non-ISO tests did). SO TBH I would still be a little wary because something is obviously not right...

My knowledge is pretty TKL/Debian/Ubuntu generic not software specific but I'll have a go at ansering your questions as best I can... My google-fu is pretty strong! :)

1) I have no idea really but I would imagine so... a quick google turned up these pages which may be relevant: 1, 2 & 3

2) Google is your friend! :) MediaWiki is really popular software - you will find tons of info!

3) This should get you going!

Sounds like a great idea! I have used MediaWiki in the past for network documentation, but TBH I now mostly use Evernote. I have also used multiple WoaS (Wiki on a Stick) files in my Dropbox which has the advantage of always being available anywhere (assuming that there is internet - very much like Evernote, but I use Evernote for heaps of stuff...!). MediaWiki is good but I don't want to host my network docs on the net (mostly cause I'm a tight wad...!) and if I don't then they're only available at work.

Jeffery P Gillivan's picture

Thanks for the follow-up. I will check out the links you have provided.

 

The documentation we are doing is for multiple networks and needs to be accessable by multiple (internal) people.  This is why I have chosen WIKI so far.  I have looked at WoaS but I would like something that is all together.

 

You confuse me becuase say you don't want you docs on the net but then you use evernote/dropbox which is by default "on the net".  LOL

 

I would eventually like our wiki to be avilable via internet but need it to be secured.  I have also thought about a CMS like Joomla or Drupal.  Not sure if a wiki or cms better fits the bill.

 

Anyway, thanks for your help.

Jeremy Davis's picture

It sounds like MediaWiki would be a good option for you. Your usage scenario sounds a little different to mine. I am one of the few IT savy people at my work and the only sys admin so my documentation is mostly for my own consumption (we are a small NGO and IT is only a part of my role and without documentation I often forget what I've done and how I did it...) and also for the security of the business should something go pear shaped while I'm not around...

Yes I probably should have said that I don't like paying for stuff to be on the net! :) I like the 'always available' side of having stuff online. Just that I'm a tight wad and don't like to pay for stuff that is purely for my consumption...

As for what platform will work best for you, it really depends on by who and how the information will be updated/added to and consumed. Both Joomla and Drupal have wiki plugins (and forums etc - FWIW the this site is built on Drupal) so in some respects they are more versitile in that sense. But MediaWiki has forum plugins too, and if it is locked down a bit it can be viewed very much as a 'standard' website. If I were you, my inclination would be to trial MediaWiki for a period of time (a month perhaps? Or maybe a little more?) and see how it works, get some feedback from other users and make a decision then. Worst case scenrio you'll need to move the info to a new platform but I would think that wouldn't be too hard (although may be a little time consuming if you have a lot of content).

Add new comment