Header left.png

Difference between revisions of "Database Services"

From Systems Group
Jump to: navigation, search
m
 
(2 intermediate revisions by 2 users not shown)
Line 18: Line 18:
 
Please e-mail [mailto:root@cs.odu.edu root@cs.odu.edu] with any further questions.
 
Please e-mail [mailto:root@cs.odu.edu root@cs.odu.edu] with any further questions.
  
== Oracle Database ==
+
== MongoDB Database ==
  
CS Department users can get access to an Oracle database upon request.By default,users get the following the privileges: '''SELECT, CREATE TEMPORARY TABLES, ALTER, UPDATE, CREATE, DROP, INSERT, INDEX, DELETE, EXECUTE, CREATE ROUTINE, ALTER ROUTINE, LOCK TABLES'''
+
A MongoDB server is provided for CS Department users, request can be granted upon request via email to root@cs.odu.edu.
  
The name of the database server is oracle.cs.odu.edu. Once you have a database you can access it through Windows and UNIX.
+
This server is using MongoDB 4.2, it is best to use the same version of mongo client connecting. C
  
=== UNIX Login ===
+
Users will be granted the following roles "readWrite" and "changeOwnPassword"
 
+
# Login to one of the [[Linux and Unix Servers|Linux and Unix servers]]
+
# At the prompt type source /usr/local/bin/coraenv
+
# When prompted for ORACLE_SID, type the SID provided to you by the administrators.
+
# For ORACLE_HOME choose /home/oracle.
+
# At the prompt type sqlplus xxxx@ZZZZ, where xxxx is the username and ZZZZ is the SID for your Database.
+
 
+
=== Windows Login ===
+
 
+
# Login to either a Lab machine or VCLAB
+
# Go to C:/sqldeveloper
+
# Run sqldeveloper.exe
+
# Choose a custom connection name, enter the username and password for the Database, for hostname choose oracle.cs.odu.edu nad enter the proper SID.
+
# Press connect.
+
 
+
== MongoDB Database ==
+
 
+
CS Department users can get access to a MongoDB database upon request. Users are granted the builtin readWrite role on their own database, as well as a custom changeOwnPassword role that allows them to change their password.
+
  
 
=== Linux Login ===
 
=== Linux Login ===
Line 49: Line 31:
 
# At the prompt type mongo mongodb.cs.odu.edu -u username -p --authenticationDatabase username
 
# At the prompt type mongo mongodb.cs.odu.edu -u username -p --authenticationDatabase username
 
# Enter your password when prompted
 
# Enter your password when prompted
 +
 +
=== Changing your mongodb user password ===
 +
 +
Users are given the ability to change their password in the mongo shell with the "changeOwnPassword" role,
 +
This can be done as follows: (values in <> are meant to be changed)
 +
 +
<nowiki>
 +
use admin
 +
db.updateUser("<username>", { pwd: "<newPassword>" })
 +
</nowiki>

Latest revision as of 19:03, 14 October 2019

The ODU CS Department provides faculty and students with the ability to access a database for use with their projects. We offer both MySQL and Oracle databases.

MySQL Database

CS Department users can get MySQL database upon request.By default,users get the following the privileges: SELECT, CREATE TEMPORARY TABLES, ALTER, UPDATE, CREATE, DROP, INSERT, INDEX, DELETE, EXECUTE, CREATE ROUTINE, ALTER ROUTINE, LOCK TABLES

The name of the database server is mysql.cs.odu.edu. You cannot access this server directly from across the Internet. Instead, please log in to one of the Linux and Unix servers, and then SSH connect to the mysql server from there.

The LOAD DATA INFILE Statement

Our MySQL servers do not support the LOAD DATA INFILE statement because it requires granting MySQL FILE privilege (a global privilege). When MySQL FILE privilege is granted, all database users have access to all files in the database directory and the privacy of user data is jeopardized. To protect user data privacy, we do not grant MySQL FILE privilege, and therefore cannot support the LOAD DATA INFILE statement.

The following excerpt from mysql.com presents the definition of the FILE privilge in version 5.1 (current CS MySQL server version):

" The FILE privilege gives you permission to read and write files on the server host using the LOAD DATA INFILE and SELECT ... INTO OUTFILE statements and the LOAD_FILE() function. A user who has the FILE privilege can read any file on the server host that is either world-readable or readable by the MySQL server. (This implies the user can read any file in any database directory, because the server can access any of those files.) The FILE privilege also enables the user to create new files in any directory where the MySQL server has write access. As a security measure, the server will not overwrite existing files."

There are other security reason involving the MySQL LOAD DATA INFILE statement that can be further referenced at http://dev.mysql.com/doc/refman/5.1/en/load-data-local.html Please e-mail root@cs.odu.edu with any further questions.

MongoDB Database

A MongoDB server is provided for CS Department users, request can be granted upon request via email to root@cs.odu.edu.

This server is using MongoDB 4.2, it is best to use the same version of mongo client connecting. C

Users will be granted the following roles "readWrite" and "changeOwnPassword"

Linux Login

  1. Login to one of the Linux and Unix servers
  2. At the prompt type mongo mongodb.cs.odu.edu -u username -p --authenticationDatabase username
  3. Enter your password when prompted

Changing your mongodb user password

Users are given the ability to change their password in the mongo shell with the "changeOwnPassword" role, This can be done as follows: (values in <> are meant to be changed)

use admin db.updateUser("<username>", { pwd: "<newPassword>" })