Mysql delete user display Nodatabaseselected

Source: Internet
Author: User
Tags mysql delete
I just got in touch with mysql and created a user yeyadmin, but didn't create a database for it. after a few days, I want to delete this user and run DELETEFROMuserWHEREUser & quot; yeyadmin & quot; andHost & quot; localhost & quot; system Display: ERROR1046 (3D000): Nodatabaseselected. The system is a virtual machine version of VM11, Ubuntu14.04 server version, and Mysql is installed online with the apt-get command. I checked several mysql instances.

I just got in touch with mysql and created a user yeyadmin, but didn't create a database for it. I want to delete this user several days later, run the delete from user WHERE User = "yeyadmin" and Host = "localhost" command. The system displays ERROR 1046 (3D000): No database selected. The system is a virtual machine VM version 11, Ubuntu 14.04 server version, and Mysql is installed online using the apt-get command. I checked several commands for deleting users on the web pages: mysql> DELETE FROM user WHERE User = "Username" and Host = "localhost ";

Mysql> flush privileges;
Mysql> drop database DBname;
I am worried that I did not create a database for this user. I created another database, yeytest, and granted all permissions to yeyadmin. Type delete from user ...... ERROR 1046 (3D000): No database selected will still be reported. continue to enter the following two commands and check the database and user again. we found that the yeytest database was deleted, however, the user yeyadmin is still there.
Thank you very much for your answers.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.