How to DROP database with different case in the name

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












I tried to drop this kind of database name in MariaDB :



MariaDB [(none)]> DROP DATABASE `db_IRP_rec` ;
ERROR 1008 (HY000): Can't drop database 'db_irp_rec'; database doesn't exist


It seems mysql doesn't give a care of the case in the name of the database same if we put the name between ` `



Thanks







share|improve this question

















  • 1




    Do you actually have a database named like that? Does SHOW DATABASES list your database the way you believe it should be listed? AFAIK, database names are stored on disk in lowercase and name comparisons are case insensitive.
    – Kusalananda
    Jul 27 at 15:39

















up vote
2
down vote

favorite












I tried to drop this kind of database name in MariaDB :



MariaDB [(none)]> DROP DATABASE `db_IRP_rec` ;
ERROR 1008 (HY000): Can't drop database 'db_irp_rec'; database doesn't exist


It seems mysql doesn't give a care of the case in the name of the database same if we put the name between ` `



Thanks







share|improve this question

















  • 1




    Do you actually have a database named like that? Does SHOW DATABASES list your database the way you believe it should be listed? AFAIK, database names are stored on disk in lowercase and name comparisons are case insensitive.
    – Kusalananda
    Jul 27 at 15:39













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I tried to drop this kind of database name in MariaDB :



MariaDB [(none)]> DROP DATABASE `db_IRP_rec` ;
ERROR 1008 (HY000): Can't drop database 'db_irp_rec'; database doesn't exist


It seems mysql doesn't give a care of the case in the name of the database same if we put the name between ` `



Thanks







share|improve this question













I tried to drop this kind of database name in MariaDB :



MariaDB [(none)]> DROP DATABASE `db_IRP_rec` ;
ERROR 1008 (HY000): Can't drop database 'db_irp_rec'; database doesn't exist


It seems mysql doesn't give a care of the case in the name of the database same if we put the name between ` `



Thanks









share|improve this question












share|improve this question




share|improve this question








edited Jul 27 at 15:35









Kusalananda

101k13199311




101k13199311









asked Jul 27 at 15:17









dubis

4181414




4181414







  • 1




    Do you actually have a database named like that? Does SHOW DATABASES list your database the way you believe it should be listed? AFAIK, database names are stored on disk in lowercase and name comparisons are case insensitive.
    – Kusalananda
    Jul 27 at 15:39













  • 1




    Do you actually have a database named like that? Does SHOW DATABASES list your database the way you believe it should be listed? AFAIK, database names are stored on disk in lowercase and name comparisons are case insensitive.
    – Kusalananda
    Jul 27 at 15:39








1




1




Do you actually have a database named like that? Does SHOW DATABASES list your database the way you believe it should be listed? AFAIK, database names are stored on disk in lowercase and name comparisons are case insensitive.
– Kusalananda
Jul 27 at 15:39





Do you actually have a database named like that? Does SHOW DATABASES list your database the way you believe it should be listed? AFAIK, database names are stored on disk in lowercase and name comparisons are case insensitive.
– Kusalananda
Jul 27 at 15:39











1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










First, check whether the database exists or not.



MariaDB> show databases;


If DB exists and you cannot delete on MySQL prompt, you can clean the DB at data directory.



MariaDB> show variables where Variable_name ='datadir';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| datadir | /var/lib/mysql/ |
+---------------+-----------------+


In my case, datas are stored under /var/lib/mysql.



We can find a folder with the same name as the database.



just remove or move to some other path.



rm -rf /var/lib/mysql/<databaseName>





share|improve this answer





















  • Hi, The command show variables where Variable_name ='datadir'; return empty value to me
    – dubis
    Jul 30 at 8:15










  • or find / -name db_IRP_rec and then rm -rf /var/mysql/db_IRP_rec that works
    – dubis
    Jul 30 at 10:34










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f458871%2fhow-to-drop-database-with-different-case-in-the-name%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote



accepted










First, check whether the database exists or not.



MariaDB> show databases;


If DB exists and you cannot delete on MySQL prompt, you can clean the DB at data directory.



MariaDB> show variables where Variable_name ='datadir';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| datadir | /var/lib/mysql/ |
+---------------+-----------------+


In my case, datas are stored under /var/lib/mysql.



We can find a folder with the same name as the database.



just remove or move to some other path.



rm -rf /var/lib/mysql/<databaseName>





share|improve this answer





















  • Hi, The command show variables where Variable_name ='datadir'; return empty value to me
    – dubis
    Jul 30 at 8:15










  • or find / -name db_IRP_rec and then rm -rf /var/mysql/db_IRP_rec that works
    – dubis
    Jul 30 at 10:34














up vote
4
down vote



accepted










First, check whether the database exists or not.



MariaDB> show databases;


If DB exists and you cannot delete on MySQL prompt, you can clean the DB at data directory.



MariaDB> show variables where Variable_name ='datadir';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| datadir | /var/lib/mysql/ |
+---------------+-----------------+


In my case, datas are stored under /var/lib/mysql.



We can find a folder with the same name as the database.



just remove or move to some other path.



rm -rf /var/lib/mysql/<databaseName>





share|improve this answer





















  • Hi, The command show variables where Variable_name ='datadir'; return empty value to me
    – dubis
    Jul 30 at 8:15










  • or find / -name db_IRP_rec and then rm -rf /var/mysql/db_IRP_rec that works
    – dubis
    Jul 30 at 10:34












up vote
4
down vote



accepted







up vote
4
down vote



accepted






First, check whether the database exists or not.



MariaDB> show databases;


If DB exists and you cannot delete on MySQL prompt, you can clean the DB at data directory.



MariaDB> show variables where Variable_name ='datadir';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| datadir | /var/lib/mysql/ |
+---------------+-----------------+


In my case, datas are stored under /var/lib/mysql.



We can find a folder with the same name as the database.



just remove or move to some other path.



rm -rf /var/lib/mysql/<databaseName>





share|improve this answer













First, check whether the database exists or not.



MariaDB> show databases;


If DB exists and you cannot delete on MySQL prompt, you can clean the DB at data directory.



MariaDB> show variables where Variable_name ='datadir';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| datadir | /var/lib/mysql/ |
+---------------+-----------------+


In my case, datas are stored under /var/lib/mysql.



We can find a folder with the same name as the database.



just remove or move to some other path.



rm -rf /var/lib/mysql/<databaseName>






share|improve this answer













share|improve this answer



share|improve this answer











answered Jul 27 at 17:08









raix d

564




564











  • Hi, The command show variables where Variable_name ='datadir'; return empty value to me
    – dubis
    Jul 30 at 8:15










  • or find / -name db_IRP_rec and then rm -rf /var/mysql/db_IRP_rec that works
    – dubis
    Jul 30 at 10:34
















  • Hi, The command show variables where Variable_name ='datadir'; return empty value to me
    – dubis
    Jul 30 at 8:15










  • or find / -name db_IRP_rec and then rm -rf /var/mysql/db_IRP_rec that works
    – dubis
    Jul 30 at 10:34















Hi, The command show variables where Variable_name ='datadir'; return empty value to me
– dubis
Jul 30 at 8:15




Hi, The command show variables where Variable_name ='datadir'; return empty value to me
– dubis
Jul 30 at 8:15












or find / -name db_IRP_rec and then rm -rf /var/mysql/db_IRP_rec that works
– dubis
Jul 30 at 10:34




or find / -name db_IRP_rec and then rm -rf /var/mysql/db_IRP_rec that works
– dubis
Jul 30 at 10:34












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f458871%2fhow-to-drop-database-with-different-case-in-the-name%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay