Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to drop database based on MySQL Engine #6063

Open
rangez opened this issue Jul 19, 2019 · 6 comments
Open

How to drop database based on MySQL Engine #6063

rangez opened this issue Jul 19, 2019 · 6 comments
Assignees

Comments

@rangez
Copy link

@rangez rangez commented Jul 19, 2019

This problem occurs when I delete the database based on the MySQL storage engine.

This is My Create database stament:
SHOW CREATE DATABASE mydb; CREATE DATABASE mydb ENGINE = MySQL('localhost:3306', 'docker', 'docker', 'docker')

This is Exception when I try to drop database:
Code: 48. DB::Exception: Received from localhost:9000. DB::Exception: MySQL database engine does not support remove table..

@alexey-milovidov

This comment has been minimized.

Copy link
Member

@alexey-milovidov alexey-milovidov commented Jul 19, 2019

@zhang2014

This comment has been minimized.

Copy link
Member

@zhang2014 zhang2014 commented Jul 22, 2019

I'll try to fix it. you can currently drop the database using the following command:

clickhouse :) DETACH DATABASE {need drop database name}
clickhouse :) exit
~ cd {clickhouse data path}
~ rm -rf metadata/{need drop database name}
@rangez

This comment has been minimized.

Copy link
Author

@rangez rangez commented Jul 30, 2019

thank you very much @zhang2014

@tonal

This comment has been minimized.

Copy link

@tonal tonal commented Sep 10, 2019

Also mysql db don`t drop if not connect to it:

host2 :) CREATE DATABASE mysql_db ENGINE = MySQL('yandex.ru:3306', 'test_db', 'yandex_admin', '1234');

CREATE DATABASE mysql_db
ENGINE = MySQL('yandex.ru:3306', 'test_db', 'yandex_admin', '1234')

Ok
0 rows in set. Elapsed: 0.064 sec. 

host2 :) show databases;

SHOW DATABASES

┌─name─────┐
│ default  │
│ mysql_db │
│ system   │
└──────────┘

4 rows in set. Elapsed: 0.001 sec. 

host2 :) drop database mysql_db;

DROP DATABASE mysql_db

Received exception from server (version 19.13.3):
Code: 48. DB::Exception: Received from localhost:9000. DB::Exception: MySQL database engine does not support remove table.. 

0 rows in set. Elapsed: 0.313 sec. 
@zhang2014

This comment has been minimized.

Copy link
Member

@zhang2014 zhang2014 commented Sep 10, 2019

This is a feature that hasn't been implemented for some reason, and I will implement them as soon as possible : )

@jigetage

This comment has been minimized.

Copy link

@jigetage jigetage commented Oct 17, 2019

detach database test-db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.