Topic on Project:Support desk

For *computer-novices*?: Access denied for user 'user'@'localhost' (using password: YES)

16
Snowfalcon cu (talkcontribs)

Hello,

Is there a user-friendly way for a novice to get around this error: `DB connection error: Access denied for user 'root'@'localhost' (using password: YES) (localhost)'?

I have searched around both on here and elsewhere and the answers seem really complicated (I don't know how to shell command line type various routines; I am novice). In order to install MediaWiki, I searched around, reading, and used a YouTube tutorial, gleaning the latest MediaWiki 1.17.0, and XAMPP 1.7.7. On step four of the MediaWiki installation onto my server (Connect to Database), I get the above message. But, in both myPHPAdmin and MySQL, I set the username to root, added a password, and granted all privileges (privileges --> Edit privileges). This is the height of folly. Can I do anything in myPHP to resolve the issue?

Take care.

p.s., I am trying to put up a Wiki for a new history of science and technology course (ironic)

Thorncrag (talkcontribs)

The error is usually caused because you are using the incorrect password for the account 'root'. Check to ensure that the password is correct and that (in phpMyAdmin) 'root' is privileged to access with host 'localhost'.

Snowfalcon cu (talkcontribs)

Thank you for the timely response. I worked really hard at the issue and managed to find the right root name and password. I have managed to get up and the second to last step (INSTALL), and have run into this message, and again it is not immediately obvious for me what the next step is. Anything let me know and thanks in advance.

>>>> Setting up database...A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: CREATE DATABASE `wiki_db` from within function "MysqlInstaller::setupDatabase". Database returned error "1044: Access denied for user 'srtm'@'localhost' to database 'wiki_db' (localhost)". Backtrace:

  1. 0 /home1/srtm/public_html/wiki/includes/db/Database.php(751): DatabaseBase->reportQueryError('Access denied f...', 1044, 'CREATE DATABASE...', 'MysqlInstaller:...', false)
  2. 1 /home1/srtm/public_html/wiki/includes/installer/MysqlInstaller.php(415): DatabaseBase->query('CREATE DATABASE...', 'MysqlInstaller:...')
  3. 2 /home1/srtm/public_html/wiki/includes/installer/Installer.php(1314): MysqlInstaller->setupDatabase(Object(MysqlInstaller))
  4. 3 /home1/srtm/public_html/wiki/includes/installer/WebInstallerPage.php(1084): Installer->performInstallation(Array, Object(MysqlInstaller))
  5. 4 /home1/srtm/public_html/wiki/includes/installer/WebInstaller.php(250): WebInstaller_Install->execute(Array, Array)
  6. 5 /home1/srtm/public_html/wiki/mw-config/index.php(46): WebInstaller->execute()
  7. 6 /home1/srtm/public_html/wiki/mw-config/index.php(14): wfInstallerMain()
  8. 7 {main}
Bawolff (talkcontribs)

You might have to check the "create this user if it doesn't exist" box for the part where it asks you what (non-root) user you want your wiki to use.

Snowfalcon cu (talkcontribs)

Thanks for the response. I tried to look for that in one of the 11 web-based fragments (e.g., Language...Restart Installation) and could not find it. I tried other combinations. Ah...frustrating. Am open to another recommendation...

Bawolff (talkcontribs)

It's in "Database settings" step, and only visible if the "Use the same account as for installation " checkbox is unchecked (If that box is checked, you probably don't have to worry about it). However re-reading what you wrote, that sounds less like the issue. So you should probably ignore what i said above ;)

It more sounds like you put a database username/pass that doesn't have sufficient permission to create new databases. When mediawiki tries to log into your db with that username, mysql doesn't let it do the stuff i needs to do. (if this is on your local computer, the "root" user generally has all permissions. If you're using a hosting company, you should contact your host and ask them what db user is allowed to create new databases)

Snowfalcon cu (talkcontribs)

Thanks for the recommendation. I tried that, too, and the attempt failed. I am getting truly desperate and the only thing I can think to do now is to uninstall and reinstall the XAMPP control panel. I am looking at your second message about the sufficient permission and am trying really hard to think it through, looking around for clues. Yes, I am using a hosting company, have uploaded it to a server, and have been given the password and username. So, is there likely a tree of user names and passwords? Good grief.

Krinkle (talkcontribs)
Snowfalcon cu (talkcontribs)

Hi, thanks for response. I also tried that last week by going about Google and looking up forums and that, too did not work. I am somewhat relieved to know from what you wrote that this is not a Mediawiki but MySQL issue. Nothing seems to work. Anyway thanks again; I am looking at the link you posted and see what I can do for myself on this matter.

99.192.94.114 (talkcontribs)

"Check to ensure that the password is correct and that (in phpMyAdmin) 'root' is privileged to access with host 'localhost'."

How, exactly, is this done? phpMyAdmin is not necessarily in the default path of either the system sudo/root or current user. Much more detailed commands are required for novice users. Please don't assume that users know how to use locate to dig around in the filesystem, change paths, sudo, etc.. This is a profound problem with the installer, it's actually a deal-breaker for a non-technical user. Treat it more seriously please. There should be much more detailed error messages with direct links to the mediawiki.org problem reporting pages in the installer itself.

99.192.94.114 (talkcontribs)
99.192.94.114 (talkcontribs)

In the horrible evil impossible-for-end users process of resetting the MySQL root password and restarting MySQL, then creating the table and user to tell the mediawiki installer about, the following were immensely useful:

First you need to eliminate the simple stuff but if you can't do that you may need to reset all MySQL permissions , restart MySQL and then create a new user and table using a line like this one:

mysql> GRANT ALL ON wiki_name.* to db_user@localhost IDENTIFIED BY 'password';

Then the mediawiki installer should work and create a LocalSettings.php, and god help you if you don't know how to download it and put it in the mediawiki directory (most users couldn't), because it doesn't even offer you the option of putting it there directly (as it certainly should).

99.192.94.114 (talkcontribs)

The MySQL setup problems are actually so bad, they are the major barrier to recommending mediawiki to any project that would otherwise use some awful proprietary wiki. If a user runs into a problem at this level, there is no way to talk them through it. You might get thm as far as "sudo apt-get install phpMyAdmin" but forget it if phpMyadmin doesn't execute as a command in their default path (for whatever reason).

Accordingly it is time that the installation instructions explained in simple terms how to compile PHP with PostgreSQL support so that this can be used if there is any problem with MySQL. The odds of a good experience using PostgreSQL is higher than the odds of managing to fix any broken MySQL with an inexperienced user at the shell prompt. If not, well, fix it. In the long run PostgreSQL is more robust than MySQL for most purposes and a more likely basis for a hands-free installer. If you disagree, how about implementing flat-file storage, which tikiwiki has had for a very long time?

195.178.200.101 (talkcontribs)

I had the same error. The clue was in creation of DB and user. I created DB -> created User , but forgot to add user into the DB. After that install have been done :)

161.111.151.11 (talkcontribs)

Had the same problem and finally found out !

In phpMyAdmin, create your user and be sure you grant him all the privileges AND set the client as localhost (as I'm developping it on localhost..) Cheers

178.203.234.231 (talkcontribs)

I could solve it with following steps:

- check which databases exist

- reset the password for mysql admin database following the steps here:

https://ubuntuforums.org/showthread.php?t=2275033

- during the installation of the mediawiki I choosed a new name for my database:

per default my_wiki was set changed to an other name;