The following articles mainly introduce the basic operation steps of MySQL basic operations (console). If you are interested in the actual operations of MySQL basic operations (console, you can use this article to have a better understanding of its related content. The following is a detailed description of the article. 1. log on to the mysql server: mysql-hlocalhost (or 127.0.0.1)
The following articles mainly introduce the basic operation steps of MySQL basic operations (console). If you are interested in the actual operations of MySQL basic operations (console, you can use this article to have a better understanding of its related content. The following is a detailed description of the article. 1. Enter the mysql server: mysql-h localhost (or 127.0.0.1)
The following articles mainly introduce the basic operation steps of MySQL basic operations (console). If you are interested in the actual operations of MySQL basic operations (console, you can use this article to have a better understanding of its related content. The following is a detailed description of the article.
1. log on to the mysql server:
> Mysql-h localhost (or 127.0.0.1)-u root (enter the user name)-p (Press enter and enter the password ).
2. Use the show statement to view the databases on the current server.
- mysql>show databases;
3. Basic MySQL operations (console): use an existing database:
- mysql>use database_name;
4. Create a database:
- mysql>create database database_name;
5. display tables in a database:
- mysql>show tables;
6. Create a table:
- mysql>create table table_name(c1 varchar(20),c2 int(3),......);
7. display fields in the table book:
- mysql>describe book;
8. MySQL basic operation (console): add multiple records to the table at a time:
- mysql>insert into book values (value_1,value_2.....),.....(value_n,value_n+1);
For more detailed operations, see the MySQL reference manual.