MySQL installation test"
After installing MySQL, you also need to test it to determine whether MySQL is successfully installed. The visualization of MySQL is different from that of SQL Server. There are two test methods for MySQL: 1. Test using MySQL commands; 2. Install a client to test the connection. Because the two methods are visualized and easy to operate, we will not detail them in detail. Here we will mainly introduce MySQL test commands.
Step 1In the open DOS window, Enter command 1 to enter the directory mysqlbin,
Step 2Enter the command "mysql-u username-p ",
Step 3Enter the password (four or more passwords previously set) to MySQL,
Step 4Enter the command "use test" to open the database.
Step 5Run the "show databases;" command to display the Database List.
In addition, add some other basic MySQL commands:
1. Change the password
Mysqladmin-u username-p old password New password
For example, change the root password to 1212.
Mysqladmin-uroot-p1212 password 123456
2. Add new users
Grant select on database. * to username @ login host identified by "password"
3. display the Database List.
Show databases;
4. display the data tables in the database:
Use mysql;
Show tables;
5. display the data table structure:
Describe table name;
6. database creation:
Create database name;
7. Create a table:
Use Database Name;
Create table Name (field setting list );
8. Delete databases and tables:
Drop database name;
Drop table name;
9. Clear the records in the table:
Delete from table name;
10. Display records in the table:
Select * from table name;
11. display the errors, warnings, and notifications generated by the last executed statement:
Show warnings;
12. Only the Errors generated by the last statement are displayed:
Show errors;