Last modified: 2013-05-30 18:41:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50950, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48950 - Some of my tools don't have .my.cnf / can't create databases in tools-db
Some of my tools don't have .my.cnf / can't create databases in tools-db
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Marc A. Pelletier
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-29 19:01 UTC by Magnus Manske
Modified: 2013-05-30 18:41 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Magnus Manske 2013-05-29 19:01:32 UTC
As tool user (e.g. local-tusc), I can connect to the tools-db server using the replica.my.cnf credentials, but cannot connect to the "mysql" database (as the "sql" command would), nor can I create tusc__something databases there.

Someone wrote on https://wikitech.wikimedia.org/wiki/User:Magnus_Manske/Migrating_from_toolserver that this requires a .my.cnf file for the tool. Some of my tools (e.g. flickr2commons) have that, others (e.g. tusc) don't.
Comment 1 Peter Bena 2013-05-30 08:03:01 UTC
all new tools don't have .my.cnf by default, that is by design. The newly created replica.my.cnf contains access to both local and replicated db's (that doesn't apply for tools created before replica was working)

you should be able to type sql local in order to get connected to tools-db, the script automatically detect your configuration and attempt to use proper credentials.

This was designed by Coren so I can't tell you why is that, but IMHO users should rename replica.my.cnf to .my.cnf for all new tools and they will have access everywhere without troubles
Comment 2 Magnus Manske 2013-05-30 11:35:43 UTC
I don't care what the file is called; I care that it doesn't work, neither as mysqlf nor as the tool user:

magnus@tools-login:~$ sql local
ERROR 1045 (28000): Access denied for user 'u3067'@'tools-login.pmtpa.wmflabs' (using password: YES)
magnus@tools-login:~$ become tusc
local-tusc@tools-login:~$ sql local
ERROR 1044 (42000): Access denied for user 'p50380g50556'@'%' to database 'mysql'

Re-opening this one.
Comment 3 Marc A. Pelletier 2013-05-30 17:21:48 UTC
Two different issues:

(a) Users (as opposed to tools) do not get access to the local database; it is unclear at this time whether they should.

(b) With the new scheme in place, users do not get a database created by default, but have the right to create new ones instead.  The current 'sql' script should not attempt to connect to a database by default when requesting 'local'.  I'll fix that.
Comment 4 Magnus Manske 2013-05-30 17:35:20 UTC
Sorry if I don't make myself clear (but it's so clear in my head! ;-)

I want to create a database for a tool (e.g. "tusc"), on the tools-db server (as per recommendation).

I try to do that as the tool user, using the replica credentials, but it won't let me:

local-tusc@tools-login:~$ mysql --defaults-file=~/replica.my.cnf -h tools-db
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3340
Server version: 5.5.30-MariaDB-mariadb1~precise-log mariadb.org binary distribution

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database tusc__main;
ERROR 1044 (42000): Access denied for user 'p50380g50556'@'%' to database 'tusc__main'
Comment 5 Marc A. Pelletier 2013-05-30 18:06:29 UTC
Ah!

The database needs to be created with the name of the /DB/ user, not that of the Unix account:

create database p50380g50556__main;

Should do what you expected.
Comment 6 Magnus Manske 2013-05-30 18:41:02 UTC
Yes! Thank you, I'll add it to my labs survival notes :-)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links