Page 1 of 1
MediaWiki install problem [Resolved - thanks!]
Posted: Mon Jan 30, 2006 2:16 pm
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'.
Posted: Mon Jan 30, 2006 2:53 pm
by Ambush Commander
Check LocalSettings.php and post the code there here.
Posted: Mon Jan 30, 2006 3:03 pm
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?
Posted: Mon Jan 30, 2006 3:12 pm
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).
Posted: Mon Jan 30, 2006 3:38 pm
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
Posted: Mon Jan 30, 2006 3:41 pm
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

Posted: Mon Jan 30, 2006 3:50 pm
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
http://www.angusenterprises.co.uk/testdbconn.php
Seems to work for connection etc.
Posted: Mon Jan 30, 2006 3:57 pm
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.
Posted: Mon Jan 30, 2006 4:23 pm
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!
Posted: Mon Jan 30, 2006 4:26 pm
by Ambush Commander
Now it's just died, because of a maximum number of queries on the server.
Well, no problem. Sometime I'll file a bugzilla bug for it.