How can I let someone view and edit specific databases in MySQL - 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.

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 database hosted online

So I have created a mysql database hosted at db4free.net, and am able to access it easily from the command line or from java. My concern however, is I can only access it using my own username, password credentials. I tried to create user, but it appears I cannot as I get Access Denied. I'm assuming I don't have privileges to create users from this hosted database.
Now I want to include access to this online database in my application, but I don't know how without having major security issues. The only apparent way for another user to connect would be to include my own username, password credentials for the database but that is very unsafe.
Any ideas on how I can provide database access to users safely ?
From the front door page of the service you're using:
What db4free.net is not
db4free.net is a testing service which means it is not suitable for
production. There can be outages, data loss and security features do
not meet the standards which you expect from a professional data
hosting provider. If you need a MySQL database for production use,
please do not use db4free.net!
This seems pretty clear to me. Don't do what you're hoping to do!
Plus, it's not a good idea security-wise to open up a MySQL server to the public internet without using secured connections. Even then it's questionable. Somebody who reverse-engineers your app can pwn your database.

Installing phpmyadmin to be able to manage the mysql database the admin created for me

I dont have access to cPanel. I only can access the root of the site I am working on using FTP, with the domain name, user and password. I want to install phpmyadmin on the root so that I can manage the mysql database the admin created for me. I have the db name, user and password. What do I need to do? Do I need to download phpmyadmin, upload install it? Please give me some details and howto.
Will I actually be able to use it for such?
Also, how to migrate all contents of another mysql databse that I have also access to (having its: db name, user and password) to this one, that was created for the site I am working with.
Download phpmyadmin from the following site: http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.8.1/phpMyAdmin-3.5.8.1-all-languages.zip/download#!md5!a65d444787645735c75bca49cdb558cb
Upload it in a seperate folder on your webserver via FTP
Go to this folder and login with your database username and password
Correct the warnings and error on the bottom of the screen
(mostly security issues)
done :)
When you have any questions with errors or warnings please post a new question.

Give remote access to mysql DB without revealing the password

I want to give a remote site (owned my someone else) access to the mysql database on my server that is password protected, but I dont want to reveal the actual password to them.
Is it possible to have the mysql access file (with username and pswd) on my server, and they just connect through it, so that their site can access data in my MYSQL db, but I am not actually openely revealing the pswd to them.
Can such access also be give on a read only basis. I just want to make it so they can query the database, but not download the whole database or make changes to it.
The remote party will need credentials to be able to do anything with your MySQL database. Even if you were to open up some sort of file share to let them get to the physical files, that still doesn't let them do anything with the files (and it is not a good idea to expose the actual files outside of the database server).
Setup a separate user account just for them that provides them with just the permissions they need.
You can limit which MySQL databases the are allowed to access, and exactly what they can do in each individual database.
https://dev.mysql.com/doc/refman/5.5/en/adding-users.html

PHPMYADMIN User Access

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.