MySQL installation test"

Source: Internet
Author: User
Tags mysql commands

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;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.