Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Methods of basic operation of mysql database

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following mainly bring you the basic operation of the mysql database methods, I hope that these contents can bring you practical use, which is also the main purpose of this article I edit the basic operation of the mysql database. All right, don't talk too much nonsense, let's just read the following.

Basic operations of the database:

Sql language is mainly used to store data, query data, update data and manage relational database systems. It is developed by ibm. Sql language is divided into three types.

Ddl database definition language: database, table, view, index, stored procedure keyword: create drop alter

Dml database operation language: add, delete, modify and check insert delete update select

Dcl database control language: user access rights, security level of grant revoke

System database

Information_schema (which is not stored on disk, is a virtual library)

It mainly stores the information of some database objects in the system, such as user table information, column information, permission information, character information and so on.

Performance_schema

Mainly store performance parameters of the database

Mysql (not available before initialization)

Authorization library, which mainly stores the permission information of system users

Test

Test database automatically created by Mysql database system

Forget the mysql password

# Vim / etc/my.cnf

[mysqld]

Skip-grant-table / / add this sentence to skip user authentication

# Service mysqld restart

Mysql > Select user,password, host from mysql.user

Mysql > Update mysql.user set password=password ('lu@123456') where user='root' and host='local host'

Mysql > Flush priviledes; / / refresh permissions

Edit the main configuration file again after changing the password, delete or comment out the Skip-grant-table

Create database create database database name

Principles:

Write SQL statements with case sensitivity.

Use the Unicode data type whenever possible.

Give priority to using joins instead of subqueries or nested queries.

Try to use parameterized SQL queries instead of statements to concatenate SQL queries.

It is forbidden to use [Pinyin] + [English] to name SQL objects or variables.

Try to use stored procedures instead of SQL statements

CREATE DATABASE MYSQLDATA; is case-sensitive, unique, cannot use keywords, cannot use numbers alone, up to 128bits, the database is just a container for storing data, and tables can only be created with a database.

View database show databases

Select database ()

Select the database use database name

Delete database drop database database name

Keywords had better be capitalized and easy to read

For the above methods on the basic operation of mysql database, we do not think it is very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report