1. Delete the database name of the drop databases database;
mysql> drop database test;
That is, delete the database schema
2 . Create DATABASE Database name
mysql> CREATE DATABASE test;
Windows and Linux handle database names and table names differently, in Windows is case-insensitive, and in Linux are case-sensitive
3 Creating a dedicated user for the operational database
Syntax rules:
Create a new user and give it permissions to the database grant all privileges the on database name. * To user name @localhost identified by password
Mysql> GRANT all privileges in test * to user$localhost identified by ' 12345 ';
This gives the user who connects to the database locally all the permissions (all privileges) to operate on all objects in the home database. A permission is a measure of what a user can do with a database, specifically by creating a SELECT (retrieve) update (UPDATE) Delete (delete), and so on. In addition, the [test.*] section, for specific table operations in the database
4 Logging in to the database using user users
mysql>-U user-p
Enter Password: ******
5 specifying the database to use
Use the specified database using the database name
mysql> use home;
6 When using the MySQL monitor, forget the specified database, you can use the Select command to view the database now in use
Displays the database that is currently in use, SELECT databases ();
Mysql> Select Database ();
MySQL Basics-Database basic operations