Topic on Project:Support desk

Imartyn (talkcontribs)

Hi,

I am logged out of my locally installed mediawiki ("rockefeller_wiki_3") on Windows 7 64-bit laptop (browser accidentally deleted saved settings) and as an amateur I am getting quite lost trying to log back in and get access to my pages, and so I would greatly appreciate any help or direction. I only created one user when I set it up, and only ever accessed it locally at http://localhost/rockefeller_wiki_3/index.php/Main_Page in my browser. By trial and error I was able to figure out my user name (as says doesn't exist otherwise) but completely forget the password as was years ago when I created it and lost paper with written down as well.

Without being able to log in I cannot check my wiki's "Special:Version" page for verison, but the "DefaultSettings.php" file created when I installed it originally says that the mediawiki version is "1.23.5". The version of mysql under "C:\xampp\mysql\bin" is "Ver 14.14 Distrib 5.6.21, for Win32(x86)" , the version of xampp I use to start and stop apache and mysql is v3.2.1, and the version of php is "5.6.3".

My first search for a solution took me to the "Manual:Resetting" passwords page on the central MediaWiki. It lists 4 potential methods, but I cannot seem to make any of them work. I list the methods and the errors I encounter for each below, so if anyone sees a solution to any one of these I should be good. Alternatively, a way to extract the relevant info from mywiki (page text mainly) or disable passwords and accounts altogether would also work.

METHOD 1:"Use Special:UserLogin" or use "Use Special:PasswordReset"

I cannot use these methods as am completely logged out of my mediawiki and only get the login prompt when I redirect to the special page.

METHOD 2: "Use the changePassword.php maintenance script"

I added "C:\xampp\php" to my computer's Path variable and navigated to "C:\Users\USER\Documents\folder_for_my_wiki\maintenance" in the cmd line administrator mode where the changePassword.php is found. I enter php changePassword.php --user="xxx.yyy" --password=new_password and I get the following output:

{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}

{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\lang1033\f0\fs22 <?php\

par

# This file was automatically generated by the MediaWiki 1.24.0\par

....(i.e. the rest of the text in my LocalSettings.php file....)

\pard $wgLaTexCommand = "$IP/extensions/Math/latex.exe";\par

\pard $wgDvipngCommand = "$IP/extensions/Math/dvipng.exe";\par

\par

}

 DB connection error: Access denied for user ''@'localhost' to database 'm

' (localhost)

What is the cause of this error? How might it be resolved?

METHOD 3: "Direct database modification"

I'm afraid that the steps and info listed on the Manual:Resetting MediaWiki page assume too much knowledge/experience from me, I can't follow. Would anyone be able to break down into more steps what I should do here? There is an IT department at work that might be able to help better if the steps were more detailed too.

Thank you very much, any help or advice would be greatly appreciated

Malyacko (talkcontribs)

Whatever application was used to corrupt your file (looks like it was an application called "Msftedit" which is not part of MediaWiki), lines such as "{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}" or all the "\pard " at the beginning of lines come from RTF file format and should never be in this file which is supposed to be in plain text file format. Hence the line for the database settings cannot be found either.

Imartyn (talkcontribs)

Thank you very much. When I first installed mediawiki and extra packages I was unaware of the problem of editing the LocalSettings.php file with default windows editor (notepad in my case). I've downloaded gVim and edited the LocalSettings.php file to remove the offending "{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}} {\*\generator Msftedit .41.21.2510;}\viewkind4\uc1\pard\lang1033\f0\fs22 " text.

However, when I try the changePassword.php script again I still get the exact same error as before:

DB connection error: Access denied for user ''@'localhost' to database 'my_wiki' (localhost) ,

despite the fact that it now reads in the LocalSettings.php file without the problem first lines. I've also compared my LocalSettings.php file to the DefaultSettings.php file for other extraneous lines or formatting but can't seem to find any difference. I have MySql running from the XAMPP control panel when I do this, but do I somehow need to login from the command line or something to get access? Also why would it be trying to access database "my_wiki" when the name for my wiki is "rockefeller_wiki_3"?

2003:72:6D7C:8300:EDBE:2F20:5B5D:DFB (talkcontribs)

I currently wonder how you got MediaWiki installed and usable, if the MySQL credentials are not correct...

In the LocalSettings.php file, which you have just edited, please make sure that the username of the MySQL user is entered. It is the value of the variable $wgDBuser. The error message

Access denied for user @'localhost' to database 'my_wiki'...

makes it look like no MySQL username is being used by MediaWiki at all...

Also "my_wiki" is the name of the database, which you configured in $wgDBname in LocalSettings.php. You can use phpmyadmin to see, if this is the correct name. If the database is named differently, you will have to adjust $wgDBname to the right name.

The database name basically has nothing to do with the foldername rockefeller_wiki_3, in which you have the files of your installation.