DBMS Quiz 6

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Web apps

Generally speaking, when you create a new web app you will: create a new db create a user give user privileges to db

Row creation

INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY) VALUES (1, 'Ramesh', 32, 'Ahmedabad', 2000.00 );

Create table

create table trucks (name varchar(10)); or CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ..... columnN datatype, PRIMARY KEY( one or more columns ) );

mysql command

mysql -u <username> -p -h <host> mysql -u carlos -p -h db.thegummibear.com

Database

A database is an organized collection of data.[1] It is the collection of schemas, tables, queries, reports, views, and other objects. The data are typically organized to model aspects of reality in a way that supports processes requiring information, such as modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies.

DBMS

A database management system (DBMS) is a computer software application that interacts with the user, other applications, and the database itself to capture and analyze data. A general-purpose DBMS is designed to allow the definition, creation, querying, update, and administration of databases.

Create database

CREATE DATABASE DatabaseName;

DROP DATABASE

DROP DATABASE DatabaseName;

Create deletion

DROP TABLE table_name;

Database hosting

Database hosting is the art and science of providing a managed server that is optimized for running a relational database. Almost any host can run a web server, mail server, file share, or other file-based application

flush privileges

If you modify the grant tables directly using statements such as INSERT, UPDATE, or DELETE, your changes have no effect on privilege checking until you either restart the server or tell it to reload the tables. If you change the grant tables directly but forget to reload them, your changes have no effect until you restart the server. This may leave you wondering why your changes seem to make no difference! Grant statements don't necessarily need a flush, but it doesn't hurt.

Table, row, column, field, record

In the context of a relational database, a row—also called a record or tuple—represents a single, implicitly structured data item in a table. In simple terms, a database table can be thought of as consisting of rows and columns or fields.[1] Each row in a table represents a set of related data, and every row in the table has the same structure.

can we recover a mysql user password?

NO but you can SELECT * FROM mysql.user; Reset password; UPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='[username]';

Users

The database user is the identity of the login when it is connected to a database. The database user can use the same name as the login, but that is not required. This topic assumes that a login already exists in SQL Server. For information about how to create a login, see Create a Login.

What does the mysql.db table have in it that is useful?

The mysql.db table contains information about database-level privileges. The table can be queried and although it is possible to directly update it, it is best to use GRANT for setting privileges.

What about mysql.user

Try this: GRANT ALL PRIVILEGES ON dbTest.* To 'user'@'hostname' IDENTIFIED BY 'password'; If you are running the code/site accessing MySQL on the same machine, hostname would be localhost. GRANT - This is the command used to create users and grant rights to databases, tables,

Authentication v. Authorization

When you log on to a PC with a user name and password you are authenticating. Authorization is the process of verifying that you have access to something. Gaining access to a resource (e.g. directory on a hard disk) because the permissions configured on it allow you access is authorization

Grant statements

grant all privileges on vehicles.* to 'tom'@'localhost' identified by 'tomspwd'; grant all privileges on vehicles.* to carlos@'144.38.199.161' identified by 'carlospwd'; grant all privileges on vehicles.* to joe@'%' identified by 'joepwd';

Row creation/deletion/access

insert into trucks values ('dodge'); insert into trucks values ('toyota'); insert into trucks values ('ford'); delete from trucks where name= 'ford'; select * from trucks;

how to use DATABASE

use DATABASE


Kaugnay na mga set ng pag-aaral

Chapter 7 Information Processing Theory

View Set

1) Chapter 19: Inflammation and the Immune Response

View Set

Lab Simulation 3-2: Perform DNS Lookups on Different Servers Network +

View Set

Chapter 7 - Positive Organizational Behavior

View Set