SQL Server deny schema and grant permisson to some tables from denyed schema - sql-server-2008

I have a database in SQL Server where users have no permissions to access to some schemas, but I need them to be able to select data from some tables from denied accesse schemas.

Related

CREATE DATABASE using phpmyadmin in online server

I install phpMyAdmin on my subdomain for my clients to access their Databases, Because I can't give my Cpanel Login to them.
But my problem is when they need to create a new database, they can't do it from phpMyAdmin and they face this error
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY
'root';
And I try to create a DB using phpMyAdmin, login from cPanel but I had the same error.
No worry I can create and manage user and DB from cPanel, But the problem is I have to create a database myself when my client needs DBS.
So has I have an option for this, any type?
In your case, this error means the MySQL user does not have the required privilege to create a database. These are some options you could do:
Grant their user all privileges on all databases (not recommended):
GRANT ALL PRIVILEGES ON . TO 'sserver_sserver'#'localhost';
Create the database yourself and give their user all privileges on that specific database:
CREATE DATABASE my;
GRANT ALL PRIVILEGES ON my.* TO 'sserver_sserver'#'localhost';
Give their user all privileges to databases beginning with a certain prefix such as their business name which will allow them to create and work on as many databases as they need:
GRANT ALL PRIVILEGES ON 'businessname_%'.* TO 'sserver_sserver'#'localhost';

CREATE USER and GRANT to create a user that can access database from Power BI

I am pretty new in here and the answer might be obvious here but I am quite lost.
So, I have MySQL Database (hosted on Amazon AWS RDS). I would like to query data directly from power bi using a user (that is not the root user) with minimum privileges.
So here is the steps I did (done in MySQL Workbench):
I created a user named powerbi
CREATE USER 'powerbi'#'localhost' identified BY '12345'
I granted SELECT privilege to user
GRANT SELECT ON *.* TO 'powerbi'#'localhost'
I checked the user status using SELECT * FROM mysql.user
[Here is the output]
I want to try my connection by connecting it using MySQL workbench but I encountered an error
[connecting]
[connection error]
When I am trying to connect to the database using Power BI, here is the error I got:
[power bi error]
Any idea of what steps I missed?
i think Your Hosting Not Allow. MySql Database Remote access.
Check four point
IP Address or hosting Name
User Name
Passwords
database Name

copy all tables from a database to another database in mysql

I'm using MySQL Workbench, I have different databases and I want to copy all the tables from those databases to a new database called newDB, I don't have access to the root account, but I have user and password for every database by separate, I've exported correctly all the tables using the Data Export Wizard within MySQL Workbench, but when I'm in the newDB tab and I try to import the tables from one of the other databases using the Data Import Wizard I'm receiving this error:
ERROR 1044 (42000): Access denied for user 'userNewDB'#'%' to database 'db1'
The error message is very clear, I'm under newDB tab in MySQL Workbench and is trying to import those tables from a different database that doesn't recognize that username, is there any way that I could do this using a query and passing as parameters the user and password for db1? Let's say that the user for db1 is userdb1 and the password is passdb1. Is that possible or it is mandatory to do this under the root account that I don't have access to...
Grant all privileges to the user first:
GRANT ALL PRIVILEGES ON *.* TO 'user'#'localhost' WITH GRANT OPTION;

MySQL Access Denied for user ''#'localhost'

I am having trouble creating a database on my local server using MySQL.
Approach:
Start mysqld as administrator
Start MySQL as administrator
mysql> create database db_name;
MySQL throws an error indicating, "Access Denied for user ''#'localhost to database 'db_name'.
What do I need to specify to MySQL to create a database?
You need to provide a valid user/password combination to gain access to MYSQL.
You also need that the user you are using have the privileged to create a database.
On default, new users have zero access to the database management including creation.

MySQL database level credentials

Is it possible to have database level credentials for MySQL?
In our current system we have multiple databases in one database server, if we connect to the server using any tool we can see all databases in that server, to have more secure system.
Can we have credentials for each database.
You can't have credentials for databases. But you can have credentials for created users and grant/restrict access to any tables/databases according your policy.
create user
grant
priviledges
Yes, absolutely, you can set up access privileges on per-database basis. In fact, MySQL allows very fine-grained privileges down to table and even column level. E.g.:
-- Creates a user
GRANT USAGE ON *.* TO 'username'#'hostname' IDENTIFIED BY PASSWORD '*SOMEPASSWORD';
-- Gives the user access to a single database `database_name`
GRANT SELECT, INSERT, UPDATE, DELETE ON `database_name`.* TO 'username'#'hostname';
You probably want to read more about GRANT syntax and MySQL privileges.
Worth adding, that you are allowed to have usernames identical to database names.