Basic MySQL-basic database operations and basic mysql operations

Source: Internet
Author: User

Basic MySQL-basic database operations and basic mysql operations

1. Delete the database drop database name;

Mysql> drop database test;

Delete database mode

2. create DATABASE name;

Mysql> create database test;

In Windows and Linux, database names and table names are processed differently. In Windows, database names and table names are case-insensitive, while in Linux, database names are case-sensitive.

3. Create a dedicated user for database operations

Syntax Rules:

Create a new user and GRANT the database operation permission grant all privileges on database name. * TO username @ localhost identified by password

Mysql> grant all privileges on test * TO user $ localhost identified by '20140901 ';

This grants the user who connects to the database from the local database ALL the permissions (all privileges) to operate on ALL objects in the home database ). Permissions are used to measure the operations that a user can perform on the database. CREATE (CREATE) SELECT (Search) UPDATE (UPDATE) DELETE (DELETE) and other permissions are used. In addition, in the [test. *] section, perform operations on specific tables in the database.

4. log on to the database as a user

Mysql>-u user-p

Enter password :******

5. database used

USE the specified database USE Database Name

Mysql> use home;

6. If you forget the specified database when using the MySQL monitor, you can use the SELECT command to view the currently used database.

Displays the currently used database select database ();

Mysql> select database ();


MYsql database operations?

What do you want to do? Not clear

How can I learn the recommended learning materials for MySQL database experts? I am very grateful to you for listing them at the entry-level improvement level.

You can take a look at this book mysql database application from entry to mastery. This book is divided into three parts. The first is the basic MySQL database, which includes the basic concepts related to the database and the installation and configuration of the MySQL database. The second part is the standard SQL statement programming and application, including the operation database object, operation table object, operation index object, Operation view object, Operation trigger object and operation data. The third part is MySQL database management, which includes MySQL database user management and permission management, MySQL Database Log Management, MySQL database performance optimization, and PowerDesigner database design software.

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.