MediaWiki install problem [Resolved - thanks!]

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
AngusL
Forum Contributor
Posts: 155
Joined: Fri Aug 20, 2004 4:28 am
Location: Falkirk, Scotland

MediaWiki install problem [Resolved - thanks!]

Post by AngusL »

Not quite sure where to put this, so if this is wrong, I apologise.

I'm currently trying to install MediaWiki onto my (minimalist, for the moment) hosting, to use a remote MySQL server (this is very ad-hoc, just testing the theory).

Unfortunately, it doesn't quite seem to want to work. Although I provide it with a database username and password, it seems quite intent on not using them.

I get this at the end (error message, and showing where it's all going wrong):
MediaWiki wrote:Trying to connect to MySQL on http://www.freesql.org as root...
Connected as root (automatic)
Connected to 5.0.16-standard; enabling MySQL 4 enhancements; You are using MySQL 4.1 server, but PHP is linked to old client libraries; if you have trouble with authentication, see http://dev.mysql.com/doc/mysql/en/old-client.html for help.
Error selecting database pexiowiki: 1044 Access denied for user 'root'@'%' to database 'pexiowiki'
It shouldn't be trying to connect as root... :? It should be trying to connect as 'pexio' with the password which I've entered on the previous page, where it asks you for the server name, database name, database uname and database passwd - all of which are entered duly! Any ideas? It's quite possible I'm misunderstanding something, as I can connect to the MySQL database using a PHP script on the hosting, I'm quite sure it's just that MediaWiki seems determined to connect as 'root' to 'pexiowiki' and not as 'pexio' to 'pexiowiki'.
Last edited by AngusL on Mon Jan 30, 2006 4:27 pm, edited 1 time in total.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Check LocalSettings.php and post the code there here.
AngusL
Forum Contributor
Posts: 155
Joined: Fri Aug 20, 2004 4:28 am
Location: Falkirk, Scotland

Post by AngusL »

Unfortunately, the installation appears to fail before it creates LocalSettings.php. That's the file the install creates, which I then move into the wiki root folder?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Yes.

Make sure that you've really entered pexio, and you didn't write anything into DB root password. Screenshots of the relevant install screens as well as your version of MediaWiki and MediaWiki's diagnostics would be helpful.

Also, make sure that the password on your account at freesql is encoded according to the old standards (MediaWiki gives you a link to a place about that).
AngusL
Forum Contributor
Posts: 155
Joined: Fri Aug 20, 2004 4:28 am
Location: Falkirk, Scotland

Post by AngusL »

Thanks.

I'm using MediaWiki 1.5.5, and I have done the SET PASSWORD thing on freesql.org - and it appears to have worked.


Few screenshots of appropriate screens:
What it says once I click 'set up the wiki' on the page I get when I first navigate to the wiki URL after uploading the files
http://www.angusenterprises.co.uk/image ... onment.jpg

What I enter for the database stuff
http://www.angusenterprises.co.uk/image ... config.jpg

Ensuring I'm using the old MySQL hashing method for my password (but since it doesn't seem to ever try the user that the password applies to, I can't be certain if this is working properly, although it seems to)
http://www.angusenterprises.co.uk/image ... ssword.jpg

The end result
http://www.angusenterprises.co.uk/image ... onment.jpg
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Mmm... I'm disinclined to believe it's a problem with MediaWiki. Can you run some real elementary php MySQL code on your box to make sure you have the ability to connect? Also, MediaWiki 1.5.6 is the latest version ;-)
AngusL
Forum Contributor
Posts: 155
Joined: Fri Aug 20, 2004 4:28 am
Location: Falkirk, Scotland

Post by AngusL »

I suspect I agree. I'll just upgrade my hosting package, if all else fails. It's only like a fiver extra a month :P

http://www.angusenterprises.co.uk/testdbconn.php

Seems to work for connection etc.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Okay. I took at a look at the install code, and here's what's happening:

For some weird reason, FreeSQL lets anyone connect as root. Thus the "Connected as root (automatic) ". It just doesn't let that account access anything. You will have to purposely fail it:

Code: Select all

if( $mysqlOldClient ) {
			print "<li><b>PHP is linked with old MySQL client libraries. If you are
				using a MySQL 4.1 server and have problems connecting to the database,
				see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'
			 	>http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b></li>\n";
		}
		print "<li>Trying to connect to MySQL on $wgDBserver as root...\n";
		$wgDatabase = Database::newFromParams( $wgDBserver, "root", $conf->RootPW, "", 1 );

		if( $wgDatabase->isOpen() && false) { //tell script that the database is never open via root
			$myver = mysql_get_server_info( $wgDatabase->mConn );
			$wgDatabase->ignoreErrors(true);
			$conf->Root = true;
			print "<ul><li>Connected as root (automatic)</li></ul></li>\n";
I should file a bug for this.
AngusL
Forum Contributor
Posts: 155
Joined: Fri Aug 20, 2004 4:28 am
Location: Falkirk, Scotland

Post by AngusL »

Haha. Got it working, with that. :)

Changed it as you suggested, then changed the script a little later to bypass the error checking which would suddenly decide that there had been an error when there hadn't.

Code: Select all

if( $wgDatabase->isOpen() [color=red]&& false[/color]) {
			$myver = mysql_get_server_info( $wgDatabase->mConn );
			$wgDatabase->ignoreErrors(true);
			$conf->Root = true;
			print "<ul><li>Connected as root (automatic)</li></ul></li>\n";
		} else {
			print "<ul><li>MySQL error " . ($err = [color=red]1045[/color] ) .
				": " . htmlspecialchars( mysql_error() ) . "</li></ul></li>";
Now it's just died, because of a maximum number of queries on the server. On the upside, I'm happy because I now understand why it didn't work the first time round! Hi ho, hi ho, it's off to upgrade our package we go.

Thanks for all the help, sir!
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Now it's just died, because of a maximum number of queries on the server.
:lol:

Well, no problem. Sometime I'll file a bugzilla bug for it.
Post Reply