Working with Data Source 12

In command line, psql helps you to manage and connect the database:1

1. Type psql in command line to enter the psql command line tool.

2. In the shell, type \q to exit.

3. In the psql tool, we can create a database by directly typing:

  CREATE DATABASE bank_accounts;

4. To enter the database, we can use:

   psql database_name 

5. In the database, we can create a table:

  create table deposits(id integer primary key, name text, amount float); # Do not forget semicolon in the end.

6.  Create role, login, create password and role authorizaion:

  CREATE ROLE userName WITH CREATEDB LOGIN PASSWORD `password`;# Create role: create a user; CREATEDB: the owner has authorization of creating database; login: automatically login with current username; password: with the passwork

7. Give user privileges:

  GRANT SELECT, INSERT, UPDATE, DELETE ON tableName TO userName; # Allow user to select,insert,update,delete on the table

  GRANT ALL PRIVILEGES ON tableName TO userName;# allow people to do anything on the table

8. Remove permissions:

  REVOKE SELECT, INSERT, UPDATE, DELETE ON tableName FROM userName;

  REVOKE ALL PRIVILEGES ON tableName FROM userName;

9.  \l -- list all available databases.

   \dt -- list all tables in the current database.  

   \du -- list users.

   

时间: 2024-10-12 14:04:53

Working with Data Source 12的相关文章

C#语言实现ArcGIS数据源重置之Set Data Source功能

1.须要:依据选择的Mxd路径和目标数据源路径进行重置数据源.此处以(.Mdb为例): 主要利用到的接口: (1)IMapDocument    (2)IMapControl2     (3)IWorkspaceFactory        (4)IWorkspace   (5)IEnumDataset (6)IDataset               (7)ISpatialReference   (8)UID        (9)IEnumLayer           (10)IFeatu

Data source rejected establishment of connection, message from server: "Too many connections"

具体错误信息: 严重: StandardWrapper.Throwableorg.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Error preloading the connection poo

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

最简单的办法是因为你的my.ini中设定的并发连接数太少或者系统繁忙导致连接数被占满解决方式:打开MySQL安装目录打开MY.INI找到max_connections默认是100 .--实例 WINDOWS解决mysql Errno.: 1040错误XXXX info: Can not connect to MySQL server User: rootTime: 2004-5-20 3:00pmScript: /XXXX/XXXX.PHP Error: Too many connections

解析数据库连接字符串 (将Data Source、Initial Catalog、User ID、Password取出)

private void AnalysisConnectionstring() { string tempStr = “Data Source=192.168.2.123;Initial Catalog=caxastat;Persist Security Info=True;User ID=sa;Password=sa;Pooling=true; Max Pool Size=40000;Connect Timeout=30”; string[] paras = tempStr.Split(';'

Configuring the WebSphere Application Server data source

Configuring the WebSphere Application Server data source Version WebSphere Application Server 7.0.0.x   WebSphere Application Server 8.0.0.x Installed applications use data sources as resources to obtain connection to relational databases. To create

Data source rejected establishment of connection, message from server: "Too many connections"

错误描述: 测试一段时间没有任何问题,今天突然用户无法登录,报错如Data source rejected establishment of connection,  message from server: "Too many connections" 错误原因: 太多的连接数,登录用户过多,配置的mysql连接数过小,或者某些连接没有关闭,导致连接数过大. 问题的解决: 修改mysql的my.ini配置文件,网上的说法:mysql安装目录下的my.ini中设定的并发连接数太少或者系

[转] --- Error: “A field or property with the name was not found on the selected data source” get only on server

Error: “A field or property with the name was not found on the selected data source” get only on server up vote4down votefavorite2I publish my project without any warning on local iis and it works correctly (localhost/[myprojectName]). so, i upload t

Create Data Source when using DataBase

Open the control panel. Open "Administrator Tools" ? 3. Open "Data Source(ODBC)" and Select "Add" ? 4. Select "MySQL ODBC 5.3 Unicode Driver" or "MySQL ODBC ANDI Driver" and then "Finish" ? 5. De

mysql: Data source rejected establishment of connection, message from server: "Too many connections"

http://www.oschina.net/question/558677_66703 com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection,  message from server: "Too many connections" "Too many connections"错误 尝试加大 M