Questions tagged [drop-database]

46 questions
2
votes
1 answer

Dropping DB when there are active connections

I am trying to script the back up of a database and part of the flow is that I need to drop and then recreate the database from a backup. When there are connections to the database I get a failure message like this: DETAIL: There are 2 other…
berimbolo
  • 3,319
  • 8
  • 43
  • 78
2
votes
1 answer

mongodb cannot drop database when secondary is down

I have a replica set with 1 primary, 1 secondary and 1 arbiter. When I close secondary member, I cannot drop a database. It waits for something. However, if I open secondary member, dropDatabase is okay. What is the reason of this? Can't we drop…
2
votes
1 answer

dropDatabase called on its own for all the databases in mongoDB with Replica Sets

We use mongoDB as DBMS for our production database. We have enabled 2 replica sets for our DB. Out of blue, we noticed that both the databases in our production have been dropped. We are absolutely sure that no one with access did it. When we went…
thrust
  • 225
  • 1
  • 8
2
votes
2 answers

Drop database which has a "minus" in its name in Postgres

I've this database named a-b in postgres and I'm unable to delete it using this query drop database "a-b";. The double quotes were supposed to work but sadly, they didn't. I'm using Postgres-XL r1.3. The error message I receive is: ERROR: syntax…
Pragun
  • 1,123
  • 8
  • 20
2
votes
1 answer

Make ADO.NET (and EntityFramework) release a database

I'm creating and dropping databases on the fly for some integration tests. I'm doing all the database management at the ADO.NET level. For the tests I'm using Entity Framework because the entities is one part of what I am testing. The problem is…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
1
vote
0 answers

Postgresql error database does not exist however it exists when listing the databases

When I drop the database I have an error that it doesn't exist however when I list the databases I can see it. Here are the steps I am following: sudo -u postgres psql postgres=# \l postgres=# DROP DATABASE IF EXISTS mydbname; NOTICE: database…
Menna Magdy
  • 355
  • 1
  • 2
  • 14
1
vote
3 answers

Is there a way to drop all databases in AWS athena?

There's a bunch of test databases that I have and I'd like a way to drop all of them. They all have long random strings as names, so it kind of sucks to have to go through each one and delete, especially since you can't copy/paste.
Andy
  • 2,138
  • 3
  • 14
  • 14
1
vote
0 answers

Why dockerized mongo drops my database periodically?

I got a little web-service. On the back-end I got dockerized mongo and a few casual stuff like nodejs & nginx. Everything in separate container. And communicates via virtual network. So my web-service is working few months. And during this time my…
1
vote
1 answer

Run MongoDB commands from C#

I want to be able to run any MongoDB command from C#. I know that this can be done. I start with a simple example, instead of using the dropDatabase method from the C# driver I am trying to drop a database using the db.runCommand method as follows.…
user2307236
  • 665
  • 4
  • 19
  • 44
1
vote
1 answer

Cpanel MySQL Create/Drop database remotely

Using cpanel, I was able to create a FTP user with limited access to allow our technical support team to upload files to the server. Now, I'm kind of stuck since they also need to be able run script to create and populate databases each time we…
1
vote
0 answers

Unable to delete database "Waiting for table metadata lock" Error

I was copying a db from an RDS server, using phpmyadmin copy, to same server, one table contains huge number of records, and after approximately an hour it was still not completed, so i killed the copy process, but now i am unable to delete the…
1
vote
2 answers

how to drop a mysql database which is having numbers

I created a mysql database with name 123, when i want to drop it,it is not dropping and throwing error. I used query. DROP DATABASE 123; and also tried DROP DATABASE '123'; . The other databases with name like ABC123 are dropping. Any solution…
1
vote
1 answer

How to DROP DATABASE named "/"

There is this database created automatically with a CMS. the database name is "/" without quotes. and when trying do delete it, this shows up. mysql> DROP DATABASE /; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that…
Phil Rv
  • 75
  • 1
  • 1
  • 6
1
vote
1 answer

Drop Postgresql database

I am trying to drop a database from aspnet(c#). But It is giving me an error: There are some connections. If I delete all the connections: SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.pid <>…
Za7pi
  • 1,338
  • 7
  • 22
  • 33
1
vote
1 answer

Mongo db that does not exist but shows up in connection

I have dropped a MongoDB database called 'test' but when I connect to mongod it shows it in the connection. Please see the code below. Can you please help me understand what is going on? Is this a bug or I am missing something? Why is it that test…
RahimiSK
  • 13
  • 1
  • 4