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;
In Windows and Linux the processing of database names and table names is different, and in Windows it is not differentiated between uppercase and lowercase, while in Linux it is distinguished by uppercase and lowercase
3 Creating a dedicated user for the operational database
Syntax rules:
Create a new user and give it permission to operate on the database grant all privileges the on database name. * To [email protected] identified by password
Mysql> GRANT all privileges in test * to user$localhost identified by ' 12345 ';
This gives all the permissions (all privileges) that users of the database from the local connection user can manipulate on all objects in the home database.
Permissions are a measure of what the user can do with the database, using the Create (creating) SELECT (Retrieve) update (UPDATE) Delete (delete) permissions.
Other than that. [test.*] section, detailed 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. Ability to use the Select command to view the databases used today
Today, the database that is used is displayed in SELECT databases ();
Mysql> Select Database ();
MySQL Foundation-Basic database operations