Skip to main content

Posts

Showing posts with the label MySQL

GRANT and REVOKE in MySQL

DCL commands are used to enforce database security in multiple user database environments. Two types of DCL commands are GRANT and REVOKE. Only Database Administrator's or owner's of the database object can provide/remove privileges on a database object. SQL GRANT is a command used to provide access or privileges on the database objects to the users Syntax- GRANT privilege_name ON object_name TO { user_name | PUBLIC | role_name } [ WITH GRANT OPTION ];     CREATE ROLE testing GRANT CREATE TABLE TO testing ; The REVOKE command removes user access rights or privileges to the database objects. REVOKE privilege_name ON object_name FROM { user_name | PUBLIC | role_name }   REVOKE CREATE TABLE FROM testing ;

How do you connect remote MySQL in R?

Connecting to MySQL is made very easy with the RMySQL package. To connect to a MySQL database simply install the package and load the library. install.packages("RMySQL") library(RMySQL) Connecting to MySQL: Once the RMySQL library is installed create a database connection object. You need to create a user on the remote MySQL and GRANT ALL PRIVILEGES ON to that database. And in place of host put remote machine IP. mydb = dbConnect(MySQL(), user='user', password='password', dbname='database_name', host='host')