postgresql-heroku: unable to create a database - database

I have created a PostgreSQL database on Heroku. I have downloaded pgAdmin 4 on my macOS machine and I was able to connect pgAdmin to my remote Heroku database server instance I have just created. But now I can't do anything:
The option to create a new database is disabled for me (Object -> Create -> Database)
When I extend the databases node, I can't see the database name created in Heroku. But I see a long list of database names for which I don't have access rights
Finally I can't write any SQL scripts; the SQL editor is read-only.
Basically I can't do nothing apart from starting the pgAdmin application.
I suppose it is a matter of my user privilege. But how can I change my user privilege if the SQL editor is read-only?

You won't be able to create a database on Heroku Postgres with pgAdmin.
When you provision a database on Heroku Postgres you are given a single database, not administrative access to the whole server:
As part of the provisioning process, a DATABASE_URL config var is added to your app’s configuration. This contains the URL your app uses to access the database
You can connect to that existing database with pgAdmin, but you won't be able to create another database. The value of DATABASE_URL is a standard URI that will look something like
postgres://user:password#host:port/database
Feel free to pull individual values out of the DATABASE_URL and use them in pgAdmin.

Related

How do I publish SQL Server Database to Azure to update existing database

I publish my SQL Server database on my local machine to Azure via Management Studio.
Say I name the database on Azure "California". The first time I do it its ok.
Then I made changes on my database on local, adding columns, adding data, etc. Then I want to deploy this database to Azure again.
But now Management Studio won't let me do it. It says database "California" already exists on Azure.
I can get away with this problem by deleting existing "California" on Azure first, then deploy again. But this seems not correct...Every time I make database changes on local, I need to delete the one on Azure before I deploy?
Does anyone know how to solve this problem?
The best way is to create a database project in Visual Studio to maintain your database schema and then you can do a database compare to create a script to update the database on Azure.
http://weblogs.asp.net/gunnarpeipman/archive/2013/01/28/using-visual-studio-database-projects-in-real-life.aspx
RedGate Schema Compare will also do a similar thing.
Update Jan 2020
(I'm assuming the question is to update the schema on Azure, not update data)
If you are using Code First for creating your database. Then it is really simple.
Assuming your connection string is pointing to a local database (the one you want to update to Azure)
Make the changes to your entities
Create a new migration for those changed (Add-Migration etc)
Update the migrations to your local database.
Now just change the connection string to point to your Azure database
Update the migrations again, which will now update to the Azure database
Voila! That simple
I know its been a while since the question was asked, however, there is no accepted answer. Thus to aid anyone coming here with a similar issue the following link describes a number of methods.
I prefer deploying a SqlDb from SQL Management Studio
http://azure.microsoft.com/en-us/documentation/articles/sql-database-deploy/
How to: Deploy to SQL Database
In Management Studio, connect to an on-premises SQL Server instance that has a database you want to migrate.
1) Right-click the database --> Tasks and click Deploy Database to SQL Azure.
2) In Deployment Settings, enter a name for the database.
3) Click Connect.
4) In Server name, enter the 10-character server name, followed by .database.windows.net.
5) In Authentication, choose SQL Server Authentication.
6) Enter the administrator login name and password that you provisioned when creating the SQL Database logical server.
7) Click Options.
8) In Connection Properties, in Connect to database, type master.
9) Click Connect. This step concludes the connection specification and takes you back to the wizard.
10) Click Next and click Finish to run the wizard.
If you are using SQL 2012, you can export a data tier application (bacpac) file, then import that when you login to your SQL Azure instance.

CREATE TABLE permission denied in database 'master' on Amazon AWS RDS

I followed the instructions on AWS to set up an RDS instance with SQL server Express,
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_NET.quickstart.html
But I find that when I go to run the commane 'Update-Database' that I get:
CREATE TABLE permission denied in database 'master'.
Turns out I'm logged in as 'Guest'??? Despite setting up the db as per instructions.
So I'm expecting that I must have missed something simple, just looking for any hints as to how to get admin access to my own SQL Server hosted on RDS?
The master database is a System database internal to SQL Server. You never need to run CREATE TABLE inside that database. It sounds like you're not in the right database context: you're running commands against that database rather than your own database.

How can I Upload my ASP.NET website(with database)?

this is my first project ^_^
and I have no previous experience.
I did create the database in my project from within the MVC.
Add New Item > SQL Server Database
then I use ADO.NET Entity DataModel
and I don't need to open my connection each time I deal with the database.. it's only the connection string in the Web.config..
my question is :
how can I upload my database?
is there any resource for such beginner as me :$ ?
I did Google it but I found it very hard for me to know if this is what I want or not, that's why I came here :$
It really depends on what type of access you have to your server.
If you have remote desktop access then run remote desktop (mstsc in run) and connect to your server.
This article shows how to install your web application in IIS on server.
This blog post from Scott Guthrie shows you how to deploy your sql database to your server.
In case you only have access to your server via a control panel (plesk) you should still be able to do the same via a different interface. (you need to go through the instructions given for the specific control panel you are using).
Hope this helps.
For ASP.Net website, just upload all files using FTP, in wwwroot folder of your hosting.
For SQL Server database there are following option.
Attach your MDF file on hosting database server (if you have remote desktop).
Generate a script of whole database with full data, schema, and indexes etc. and run the script in query editor of your hosting panel.
First of all create a database from your hosting panel and a user for your database then Use SQL Serer 2008 (R2 most preferable) and connect with your hosting SQL Server using hosting server name in Server name, your db user id in User Name, and same for password. And then connect, you will find a long list of databases including your own database. Now right click on your database and import data from your local database server to remote database server.

Please explain SQL Azure "master" database

What's the "master" database in SQL Azure for? I just created a subscription and once I created a "new SQL Server" I immediately got "master" database with 1GB size. That database can't be deleted - "delete" button is not active in the management portal.
When I tried to deploy a .dbproj project there Visual Studio said it "couldn't deploy to a system database".
Can I use that database for storing my data? Do I create a new database instead?
Just a note: you will not be charged for the master DB.
master is a required system database that's responsible for holding info about all the the other database on the server instance, system metrics/config, managing logins & database creation etc, its read-only and can't be removed.
You will need to create a new database and deploy to that.
The master database records all the system-level information for a SQL Server system. This includes instance-wide metadata such as logon accounts, endpoints, linked servers, and system configuration settings

SQL Server: Granting db_datawriter on all databases

I want to manage permissions and access to a SQL Server database server on a development machine. I've created a local windows group (called DBReaderGroup) and assigned various people to it. The group was created as a SQL Server login successfully:
create login [MYMACHINE\DBReaderGroup] from windows
My goal is to grant this group read/write access to all databases (which are constantly being added and dropped). Is it possible to configure the right settings so that SQL Server manages this?
My biggest challenge is that each time a db is created, I have to update the "User Mapping" settings for this group on the new database.
Am I missing something simple?
Add the login to the Model database in the db_datawriter role, and any new database will give that login full write access by default. This won't work, however, if the databases being added are from other sources (ie restored versions).

Resources