WebFaction
Community site: login faq

I have other users on my team to whom I've given ssh accounts. I know they can use this to tunnel into the server via putty, but can they also use them to have access to the phpMyAdmin interface. I don't want them to have access to the master control panel, but do want them to be able to use that interface for running queries on the server.

Thanks!

asked 27 Nov '10, 08:57

Telos3K's gravatar image

Telos3K
11113
accept rate: 0%


As it happens, I've just spent the past hour setting up a similar scenario.

My database: myid_secrets.

Access requirements:

  • user julian should have read-only access to this database
  • user barack should have full access to this database

How to:

  1. Use the webfaction control panel to create databases corresponding to the two users: myid_barack and myid_julian
  2. From the command line, log in as myid_secrets: mysql -u myid_secrets -p
  3. Then, in mysql, GRANT ALL PRIVILEGES ON myid_secrets.* TO myid_barack@'localhost';
  4. and GRANT SELECT, SHOW VIEW ON myid_secrets.* TO myid_julian@'localhost';

To verify the grants, log in to mysql as either of the two users and show grants;. You won't be able to see these grants when you're logged in as mysql_secrets. Later, you can also revoke the grants, logged in as mysql_secrets.

We've been working this way for a good long while. It will provide access as expected via phpMyadmin as well.

permanent link

answered 10 Dec '10, 16:26

cesnn's gravatar image

cesnn
93513
accept rate: 14%

edited 10 Dec '10, 16:38

Note: in some cases this could produce an error of the type:

ERROR 1044 (42000): Access denied for user

In these cases, try escaping underscores in the database name (but not the user name); for example:

GRANT ALL PRIVILEGES ON `myid\_secrets`.* TO "myid_barack"@"localhost";
GRANT SELECT, SHOW VIEW ON `myid\_secrets`.* TO "myid_julian"@"localhost";

This should normally not be necessary. But, I am recording this solution here in case anyone encounters this problem.

(17 Apr '11, 01:56) ryans ♦♦ ryans's gravatar image

Make sure to use backticks (accent grave) around the database name - apostrophes will cause the commands shown to fail.

(13 Apr '12, 11:01) maryh ♦♦ maryh's gravatar image

This was just what I needed, it lets me get the job done even though it ends up creating empty, unused databases. Thanks!

(28 Jun '12, 19:38) squareup squareup's gravatar image

Hey, sorry to dredge up an old-ish thread. Can anyone confirm whether this still works?

After I execute the equivalent of either step 3 or 4 (my 'main' user is called mozz_shkspr) I get:

ERROR 1044 (42000): Access denied for user 'mozz_shkspr'@'localhost' to database 'mozz_shkspr'

...which, since I can execute the following without any troubles, suggests that I don't have privileges to GRANT. Have I got something wrong?

SELECT * FROM mozz_shkspr.works;

(I see the data from the table - so I DO have access!)

(31 May '13, 17:28) mozz mozz's gravatar image

I don't think we're giving GRANT privileges by default any more. If you need them, feel free to open a support ticket and let us know which user should have GRANT on which database.

You also have the option of running a private MySQL instance if you want complete control over your databases and database users.

(31 May '13, 17:49) seanf seanf's gravatar image

Hi,

Since each database is it's own user you can give them the database name and password, they will only be able to access and query the 1 database you've given them the info for.

permanent link

answered 04 Dec '10, 23:16

klynton's gravatar image

klynton
1.6k129
accept rate: 42%

-1

No, you cannot add additional users for phpMyAdmin access. You can only access phpMyAdmin using the database name as the user name, and the database password as the password to log in. You are unable to add other users to the database.

If you require more control, you will need to run your own instance of MySQL.

permanent link

answered 27 Nov '10, 09:04

aaronh's gravatar image

aaronh ♦♦
1.3k3
accept rate: 34%

If you do decide to run your own MySQL instance (which gives you full root access into your database server), it can be installed as per the instructions here.

(28 Jun '12, 20:45) ryans ♦♦ ryans's gravatar image

We also announced private instances of MySQL via the installer from our Control Panel. That should simplify the installation process for anyone wanting full control over MySQL. Please see the announcement for more information.

http://blog.webfaction.com/2012/10/introducing-private-mysql-instances/

(29 Nov '12, 08:17) aaront ♦♦ aaront's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×23

question asked: 27 Nov '10, 08:57

question was seen: 12,312 times

last updated: 31 May '13, 17:49

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM