Log on to the database
"Command prompt character" window entry,
Input CD C:mysqlbin and press ENTER to switch directory to CD C:mysqlbin
And then type the command mysql-uroot-p, enter after the prompt you to lose the password, if just installed MySQL, superuser root is no password, so direct return can enter into MySQL, MySQL prompt is:mysql> modify password
C:mysqlbin Prompt Entry:
Format: Mysqladmin–u username-P Old password password new password
For example: Add a password to root ab12. Type the following command:
Mysqladmin-uroot Password AB12
Building a Database
Format: Create database library name;
For example: Create a new database Shopex
In the MySQL prompt:mysql> input create database Shopex;
Show Database
Format: show databases;
Attention is databases, not database.
Create a new user
Format: Grant all privileges on database. * To User name @ login host identified by "password";
For example: Add a user test password of 1234, so that he can only log on localhost, and can do all the operations on the database Shopex (localhost refers to the local host, that is, the MySQL database hosting the host), Under the MySQL prompt:mysql> entry grant all privileges on shopex.* to test@localhost identified by "1234";
By doing this, you create a new database Shopex and add a name to the Shopex database with all the permissions to operate.
Note: The above is just a simple mysql operation command, if you need to know more detailed information, please check the MySQL related operation instructions documentation.