Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-30-2014, 07:28 PM
|
#1
|
Member
Registered: Oct 2013
Posts: 37
Rep:
|
Mysq: Can't delete databases as root user, why?
Hello!
I installed mysql in my Debian Wheezy and after install the first thing i did was log as root. As normal user for linux and as root for mysql with this command "mysql -u root -p"
Then, i entered with this command "show databases;" and mysql showed me this:
Quote:
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
|
When i tried to delete them i got this error message:
Quote:
mysql> drop database information_schema;
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'
|
So i would like to know why mysql doesn't let me delete these databases? I'm the root user i should have permission to delete these databases, i think.
Last edited by robgeek; 06-30-2014 at 10:51 PM.
|
|
|
06-30-2014, 08:02 PM
|
#2
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,293
|
Quote:
Originally Posted by robgeek
Hello!
I installed mysql in my Debian Wheezy and after install the first thing i did was log as root. As normal user for linux and as root for mysql with this command "mysql -u root -p"
Then, i entered with this command "show databases;" and mysql showed me this:
When i tried to delete them i got this error message:
So i would like to know why mysql doesn't let me delete these databases? I'm the root user i should have permission to delete these databases, i think.
|
Self preservation! The mysql database holds all the internal info, user access rights and other info for every other database and mysql cannot run without it! Similar for the others...
Why would you want to delete them?
EDIT*** - It is also worth pointing out that the mysql 'root' user is created mostly as a convenience and does not necessarily correspond to the system root user, so there is really no reason to think that the root user can do anything within mysql - a common misconception.
Last edited by astrogeek; 06-30-2014 at 08:20 PM.
|
|
1 members found this post helpful.
|
06-30-2014, 09:13 PM
|
#3
|
Member
Registered: Oct 2013
Posts: 37
Original Poster
Rep:
|
Quote:
Originally Posted by astrogeek
Self preservation! The mysql database holds all the internal info, user access rights and other info for every other database and mysql cannot run without it! Similar for the others...
Why would you want to delete them?
EDIT*** - It is also worth pointing out that the mysql 'root' user is created mostly as a convenience and does not necessarily correspond to the system root user, so there is really no reason to think that the root user can do anything within mysql - a common misconception.
|
I tried to delete them just to see what happens. So, doing what i did, am i actually logged as root? And, being root, i'm the manager of the database, right? So i have freedom to do whatever i want on my system?
|
|
|
06-30-2014, 09:18 PM
|
#4
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,293
|
Quote:
Originally Posted by robgeek
I tried to delete them just to see what happens. So, doing what i did, am i actually logged as root? And, being root, i'm the manager of the database, right? So i have freedom to do whatever i want on my system?
|
And what you saw happen was that mysql will not allow you to drop those databases.
To repeat...
Quote:
The mysql 'root' user is created mostly as a convenience on most distros and does not necessarily correspond to the system root user, so there is really no reason to think that the root user can do anything within mysql - a common misconception.
|
Within mysql, "root" is just a user name - it is not a mysql version of the system root user and may have any allowable mysql permissions, or none at all.
It has nothing to do with you being root, mysql will not allow you to delete those databases because it would break mysql.
Unlike the Enterprise, mysql does not have a built in self-destruct mechanism!
Last edited by astrogeek; 06-30-2014 at 09:27 PM.
|
|
1 members found this post helpful.
|
06-30-2014, 10:50 PM
|
#5
|
Member
Registered: Oct 2013
Posts: 37
Original Poster
Rep:
|
Quote:
Originally Posted by astrogeek
And what you saw happen was that mysql will not allow you to drop those databases.
To repeat...
Within mysql, "root" is just a user name - it is not a mysql version of the system root user and may have any allowable mysql permissions, or none at all.
It has nothing to do with you being root, mysql will not allow you to delete those databases because it would break mysql.
Unlike the Enterprise, mysql does not have a built in self-destruct mechanism!
|
Ok. I understand now.
Thank you!
|
|
|
06-30-2014, 11:31 PM
|
#6
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,293
|
Quote:
Originally Posted by robgeek
Ok. I understand now.
Thank you!
|
You are welcome! Good luck!
|
|
|
All times are GMT -5. The time now is 06:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|