Topic on Project:Support desk

How to fix the Access Denied message with PhpMyAdmin or anything else MySQL?

21
Newman2 (talkcontribs)

MediaWiki Version: 1.30

PHP Version: 5.6.36 (litespeed)

MySQL Version: 5.6.39-cll-lve

ICU Version: 57.1

Hello. When I tried to create an additional database for a second wiki (Penguiconverter) after that second wiki couldn't have separate pages and files from the first wiki (Penguin Ice Wikis), I got the following error on that wiki: (Cannot access the database: Access denied for user 'gjlxrtap_wiki'@'localhost' (using password: YES) (localhost))

I already have both databases set up. I also cloned the information from the old database by exporting the data and importing it into the new one. If this is the correct way to set up a new database, then what do I need to do to gain access to the database? If cloning by exporting and importing is the incorrect way, then what should the database look like?

I also tried another way to create a database, by copying the structure only of the original database in order to create another database. However, I still got an access denied message for this database too.

Newman2 (talkcontribs)

I really need a helpful reply so that I can get this wiki family up and running.

星耀晨曦 (talkcontribs)

First, make sure your database user have access to these 2 databases.

In mysql shell, execute show grants for 'gjlxrtap_wiki'@'localhost'; to check your user rights.

Newman2 (talkcontribs)

I tried to execute show grants, and I got the following error: #1044 - Access denied for user 'cpses_gj4v7w8hq1'@'localhost' to database 'mysql'

星耀晨曦 (talkcontribs)

Please execute this command as root user.

Newman2 (talkcontribs)

How do I do that? And, I have to pay to execute SSH commands on my web host server.

星耀晨曦 (talkcontribs)

Where "root user" is a your mysql user, but have all rights. Use mysql -uroot -p to login. If you can't do this, you can try creating an account and giving it access to your second database, your host management panel may be able to do it.

Newman2 (talkcontribs)

How do I create an account on PhpMyAdmin?

星耀晨曦 (talkcontribs)

Can you login with root user?

Newman2 (talkcontribs)

I added a user to my database, and I got the following error: [WzvEMcJwPUEZ3q69aqV70QAAANI] 2018-07-03 18:45:06: Fatal exception of type "Wikimedia\Rdbms\DBQueryError". What can I do to fix this?

星耀晨曦 (talkcontribs)

Add following to your LocalSettings.php

$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;

to show detail message.

Newman2 (talkcontribs)

Just did that, and it worked. Now what do I do?

星耀晨曦 (talkcontribs)

Give us detailed error information to help us solve your problem.

Newman2 (talkcontribs)

It looks something like this:

[Wz03lFwtCOv-yYg8e1qVvgAAAY4] /mw19/ Wikimedia\Rdbms\DBQueryError from line 1149 of /home/gjlxrtap/public_html/mw19/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SELECT user_id,user_name,user_real_name,user_email,user_touched,user_token,user_email_authenticated,user_email_token,user_email_token_expires,user_registration,user_editcount FROM `gjlxrtap_mw19758`.`mwd50q_user` WHERE user_id = '1' LIMIT 1

Function: User::loadFromDatabase

Error: 1142 SELECT command denied to user 'gjlxrtap_wiki2'@'localhost' for table 'mwd50q_user' (localhost)

Backtrace:

#0 /home/gjlxrtap/public_html/mw19/includes/libs/rdbms/database/Database.php(979): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)

#1 /home/gjlxrtap/public_html/mw19/includes/libs/rdbms/database/Database.php(1343): Wikimedia\Rdbms\Database->query(string, string)

#2 /home/gjlxrtap/public_html/mw19/includes/libs/rdbms/database/Database.php(1411): Wikimedia\Rdbms\Database->select(string, array, array, string, array, array)

#3 /home/gjlxrtap/public_html/mw19/includes/user/User.php(1287): Wikimedia\Rdbms\Database->selectRow(string, array, array, string, array)

#4 /home/gjlxrtap/public_html/mw19/includes/user/User.php(496): User->loadFromDatabase(integer)

#5 /home/gjlxrtap/public_html/mw19/includes/libs/objectcache/WANObjectCache.php(892): User->{closure}(boolean, integer, array, NULL)

#6 [internal function]: WANObjectCache->{closure}(boolean, integer, array, NULL)

#7 /home/gjlxrtap/public_html/mw19/includes/libs/objectcache/WANObjectCache.php(1012): call_user_func_array(Closure, array)

#8 /home/gjlxrtap/public_html/mw19/includes/libs/objectcache/WANObjectCache.php(898): WANObjectCache->doGetWithSetCallback(string, integer, Closure, array, NULL)

#9 /home/gjlxrtap/public_html/mw19/includes/user/User.php(521): WANObjectCache->getWithSetCallback(string, integer, Closure, array)

#10 /home/gjlxrtap/public_html/mw19/includes/user/User.php(441): User->loadFromCache()

#11 /home/gjlxrtap/public_html/mw19/includes/user/User.php(405): User->loadFromId(integer)

#12 /home/gjlxrtap/public_html/mw19/includes/session/UserInfo.php(88): User->load()

#13 /home/gjlxrtap/public_html/mw19/includes/session/CookieSessionProvider.php(119): MediaWiki\Session\UserInfo::newFromId(string)

#14 /home/gjlxrtap/public_html/mw19/includes/session/SessionManager.php(487): MediaWiki\Session\CookieSessionProvider->provideSessionInfo(WebRequest)

#15 /home/gjlxrtap/public_html/mw19/includes/session/SessionManager.php(190): MediaWiki\Session\SessionManager->getSessionInfoForRequest(WebRequest)

#16 /home/gjlxrtap/public_html/mw19/includes/WebRequest.php(735): MediaWiki\Session\SessionManager->getSessionForRequest(WebRequest)

#17 /home/gjlxrtap/public_html/mw19/includes/session/SessionManager.php(129): WebRequest->getSession()

#18 /home/gjlxrtap/public_html/mw19/includes/Setup.php(762): MediaWiki\Session\SessionManager::getGlobalSession()

#19 /home/gjlxrtap/public_html/mw19/includes/WebStart.php(114): require_once(string)

#20 /home/gjlxrtap/public_html/mw19/index.php(40): require(string)

#21 {main}

星耀晨曦 (talkcontribs)

Your "gjlxrtap_wiki2" user does not enough permissions to access mwd50q_user table.

Newman2 (talkcontribs)

How to I give my user enough permissions to access the mwd50q_user table?

Newman2 (talkcontribs)

^Read the post above.

星耀晨曦 (talkcontribs)

I don't know if your hosting provider has provided this feature. I can only tell you how to use root user to give permission:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gjlxrtap_mw19758`.* TO 'gjlxrtap_wiki2'@'localhost';
Newman2 (talkcontribs)

I tried to do this by running an SQL query in PhpMyAdmin, and I got the following error: #1044 - Access denied for user 'gjlxrtap'@'localhost' to database 'gjlxrtap_mw19758'

Newman2 (talkcontribs)

Okay... I can't find this in the designer of PhpMyAdmin. If it is in the MediaWiki file directory, what file and folder is it located in? If it is located in the database, where can I find it in PhpMyAdmin?

112.134.113.69 (talkcontribs)

You can ask your hosting provide for further help.

Reply to "How to fix the Access Denied message with PhpMyAdmin or anything else MySQL?"