PHPMYADMIN User Access - mysql

Ok so I got one linux(centos) dedicated server. I was paying someone to look after my server. Now I remember for security purpose I asked him to disable access to PHPMYADMIN for all user exvept root. Now I want to enable access to phpmyadmin for one user only.
how can I do that, so that specific user can access phpmyadmin through cpanel/whm ?
Thanks

Why don't you simply create a new user in phpmyadmin? Then you have root and the new user who can connect to the database. Unless you meant that the restriction is on server side (server user), that's a whole different story.

Related

How to give somebody access to only some MySQL tables when I cannot create a new MySQL user?

I am searching for the best solution of the following:
I need to give somebody access to one (out of many) specific database on my MySQL server through PhpMyAdmin or a similar tool.
I am not allowed to create a new MySQL user account.
Therefore I am thinking of creating a cover-up username and password (the credentials might be stored in some table or even directly in PHP somewhere around PMA), with which my somebody would log in to PMA.
PMA would use a securely stored real username and password to connect to my MySQL server. But my somebody would never see the actual database username and password. He would only see and be able to edit tables within the one specified database on my server.
Is this somehow achievable? Thank you!
PMA has a configuration for this.
$cfg['Servers'][$i]['only_db']
Read about it in the documentation: https://docs.phpmyadmin.net/en/latest/config.html
But this does not restrict the privileges of the user. It only makes the user interface show a limited subset of databases to the user. If they know the name of some other databases (or can query them from INFORMATION_SCHEMA.SCHEMATA), they can still access those databases.
If you want to enforce privileges to only a few databases, you'll have to create a distinct MySQL user and limit their privileges with GRANT.
Re your comments:
It sounds like you need to store the MySQL credentials in your PMA config file (and set $cfg['Servers'][$i]['auth_type'] to 'config'). Then you can use Apache HTTP authentication to restrict access to your PMA site (or directory), and you can create multiple user credentials at the Apache level.
phpMyAdmin is not designed to work like this; it uses the MySQL authentication structure without imposing any additional login restrictions.
One part of your requirements (not sharing the actual username and password) might be solved by using the config or signon authentication method, but that still doesn't impose any additional restrictions on the user once they log in so they'd have the same access that your user account has.
Unfortunately for you, if you aren't able to create another user account it's going to be difficult to share the account without giving them the same level of access.

MySQL Workbench - Define database in connection settings

I was wondering whether there is a way to define a specific database in the connection setup of MySQL Workbench (I know this works with other database software). Sometimes I have a lot of different databases on one server and I only want to access one with one connection. Can I specify the database in the connection settings somehow?
YES, On the home tab Click the + in MySQL Connections. And put the database name in the Default Schema: when you fill in all the usual info about ip address etc
Now if you only want to see the one database, then create a new MySQL user account and only allow this new account access to this single database. Then change the connection to the database to use the newly created MySQL account.
I guess you are seeing all the databases because you are using the root account.

old web host doesn't have phpmyadmin, remote access?

A new client of mine has a site hosted on netnation (boo). Their account manager doesn't have a way to access phpmyadmin or anyway to access the database. I'm not a programer, I'd just like to be able to view a stored password so I can give it to my client. I have the database host, user, password, and database name in the php files of the site.
Is there a program that I can use to view the database? No command line please it's not my thing and I'd probably break something.
Thanks
Most live databases don't allow direct access from outside the server, so if you're unlucky it can't work unless you can configure mysql to allow access from remote clients, too.
But at least you can try. Just configure any phpmyadmin installation (locally or on another server) to connect to that database. You do that in the file config.inc.php in the phpmyadmin root directory.
Look for the line that says "$cfg['Servers'][$i]['host'] = 'localhost';". Just replace 'localhost' with the url or IP your database is running (usually the same as the website). If your mysql allows remote access, you should be good to go. Otherwise you will have to re-configure your mysql installation first to allow that.
MySQL Workbench is a GUI program that allows access to MySQL database. It can work directly or using SSH. Most likely you won't be able to connect directly so your best chance is to get SSH access and connect using it. If it's not an option you can get FTP access and install phpMyAdmin (simply by uploading it to server).
Also, it's considered a bad practice to store password in DB, so it's very likely that the password itself is not stored, just its hash.

How can I let someone view and edit specific databases in MySQL

"How can I let someone view and edit specific databases in MySQL"
I ask this question to my web hosting company then they said "You need to give cPanel ID and password for him to edit your databases
I feel so insecure in giving full access of cPanel
I just want to add an user ID and password into specific databases then I'll give them for him to access
In cPanel it's easy to create a FTP user for someone to access specific folders.
Isn't there any way to do it like FTP?
If you can upload scripts to the server (I assume you can) you can always install standalone instance of PhpMyAdmin, and configure this instance to only access specific server/databases. Moreover - creating custom login and password allows you to grant access only to specific database/tables etc.

Webmin - Associate a subdomain to more than one DB

I'm pretty new to server configuration and I'm stucked with this situation. I have a domain and a couple of subdomain for test. From each one i can connect to the database that have been created toghether with the subdomain. Now i would like to acces another DataBase (created with phpMyAdmin) from one of this subdomains, but my script (it is working) report me that "Cannot Find Database".
Is possible to make this database reachable from that domanain?
Thanks in advance.
By default all database in webmin can be access from any site, double check database access I mean make sure your use username have access to this database and some times webmin truncate username go to user and copy it as it's in webmin.