Show DATABASES the database is not full with access denied ERROR__ database

Source: Internet
Author: User
Tags odbc

When using the command line to manipulate MySQL, I encountered access denied for user @ ' localhost ' to database ' ... ', that is, there is no access rights, there is also input show DATABASES, when the view of the database display is not complete. First of all, the MySQL used here is integrated into the Wamp, in the installation of Wamp after the MySQL service.

After you configure the MySQL Bin folder path under Wamp to the system variable, open the CMD command line and enter MySQL and return:

Shows that the login was successful.

you want to create a database with the name T1, enter create DB T1 at the command line, and then return:

Discovery prompts access denied for user ' @ ' localhost ' to database ' T1 ' error, apparently telling me to be barred from access, and that's why. Regardless of why, let's look at what database we already have in MySQL.

Enter show DATABASES, rear carriage return:

Only two databases were found, but there are obviously more databases under my MySQL:

This is all for what.

then output Select User (), and then return to view user information:

Display the user name is ODBC, but my wamp username is root, obviously not a user, carefully analyzed, originally I entered the first login only MySQL, did not specify the username, where I think MySQL will use its default username, So it's not surprising that the MySQL username "ODBC" after login (ODBC's English is all called Open Database connectivity, providing a set of standard APIs for database access).

Enter show grants, and then return to view User rights:

Show Grant USAGE, in fact, is only allowed to connect, other database operations such as the deletion of the right to check is not. By the way, this "@ ' localhost" is meant for anonymous users.

enter exit, return to exit the current login, enter Mysql-u root and return, this time the user named Root, the password is blank login (because wamp mysql Default user account is this, and I have not modified):

This shows the user name as root.

then look at the current permissions and see that all permissions are available, and that creating the database T1 also succeeds:

Wamp under the MySQL interface:

Summary: the reason for the error is not specified username to login MySQL wamp for us to specify the default account for MySQL, the user name is root, the password is empty. So we have to use this account in the cmd command line to login to the Wamp under the MySQL to get all the permissions and show that we previously in phpmyadmin operation of all databases.

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.