Disclaimer: The following is not original, just a recent study notes collation.
--------------------------------------
Go to the MySQL installation path bin directory:
1. Turn on the service
Winmysqladmin.exe
Enter follow the prompts:
Enter winmysqladmin initial user, password (note: MySQL user, password) fill in the necessary meaning
2. root directory password reset
Mysqladmin-u root-p Password 123456
Enter appears
Enter Password: (Note: Call to enter the original password. The password is empty at the time of installation, the direct enter is the)
At this point the MySQL account root password is changed to 123456 installation completed!
3. Log in to MySQL:
Mysql-u User name-p user Password
4. Displays the list of databases.
show databases;
Description: There are two databases by default: MySQL and test. MySQL inventory in the MySQL system and user rights information, we change the password and the new user, is actually to operate the library.
5. Display the data table in the library:
Use MySQL
Show tables;
6. Displaying the structure of a database table
describe table name;
7. Create the database and delete the database:
Create database name;
drop database name;
8. Build tables and Delete tables:
Use library name;
CREATE TABLE table name (field list);
drop table name;
9. Clear the records in the table:
Delete from table name;
10. Display the records in the table:
SELECT * from table name;
11. Export Data:
Mysqldump--opt Test > Mysql.test
Description
Export the database test database to the Mysql.test file, which is a text file
12. Import Data:
Mysqlimport-u root-p123456 < Mysql.dbname
13. Import text data into the database:
Description: The field data for text data is separated by the TAB key.
Use test;
Load data local infile "file name" into table name;
14. Clear invalid and Error commands:
\c
15. Exit
\q
16. View Help
\h
-------------------------------------------------------