美文网首页
MySQL基础01-简介

MySQL基础01-简介

作者: 四月不见 | 来源:发表于2022-01-07 20:26 被阅读0次

一、MySQL启动方式

1、Windows:

方法一:
以管理员身份运行cmd打开dos窗口,输入net start mysql80。(mysql80为实际服务名称)

C:\Users\Administrator>net start mysql80
MySQL80 服务正在启动 .
MySQL80 服务已经启动成功。
C:\Users\Administrator>net stop mysql80
MySQL80 服务正在停止.
MySQL80 服务已成功停止。

方法二:用cmd输入services.msc打开windows服务,找到MySQL服务右键点击启动。

2、Linux:

service mysql start  # 启动
service mysql stop  # 停止
service mysql restart  # 重启
service mysql status  # 查看状态

systemctl start mysql
systemctl stop mysql
systemctl restart mysql
systemctl status mysql

二、连接MySQL

语法:

$> mysql -h host -u user -p
Enter password: ********

如:

[nosee@instance-4 /]$ mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.27 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit;
Bye
[nosee@instance-4 /]$ 

三、SQL语句

SQL语句的分类:DDL、DML、DQL、DCL

  • DDL(Data Definition Language)数据定义语言
    用来定义数据库对象:数据库等。关键词:createdropalter
  • DML(Data Manipulation Language)数据操作语言
    用来对数据库中表的数据进行增删改。关键词:insertdeleteupdate
  • DQL(Data Query Language)数据查询语言
    用来查询数据库中表的数据。关键词:selectwhere
  • DCL(Data Control Language)数据控制语言
    用来定义数据库的访问权限``和安全级别,及创建用户。关键词:grantrevoke

四、查看帮助

mysql> help contents;
You asked for help about help category: "Contents"
For more information, type 'help <item>', where <item> is one of the following
categories:
   Account Management
   Administration
   Components
   Compound Statements
   Contents
   Data Definition
   Data Manipulation
   Data Types
   Functions
   Geographic Features
   Help Metadata
   Language Structure
   Loadable Functions
   Plugins
   Prepared Statements
   Replication Statements
   Storage Engines
   Table Maintenance
   Transactions
   Utility

mysql>

五、参考

8.0官方文档:https://dev.mysql.com/doc/refman/8.0/en/

相关文章

  • MySQL基础01-简介

    一、MySQL启动方式 1、Windows: 方法一:以管理员身份运行cmd打开dos窗口,输入net start...

  • 1. MySQL 基础

    1 MySQL 安装和基础使用 1.1 MySQL 简介 1.1.1 MySQL 版本 MySQL MariaDB...

  • MySQL 基础 1 MySQL简介

    1.1 数据库的概述 1.1.1 数据库的概述 什么是数据库数据库就是一个文件系统,通过标准的SQL语句获取数据 ...

  • MySQL基础之STRAIGHT JOIN用法简介

    MySQL基础之STRAIGHT JOIN用法简介 引用mysql官方手册的说法: STRAIGHT_JOIN i...

  • MySQL基础(1)——简介

    数据库 数据库是什么?百度百科上有两种定义: 数据库是按照数据结构来组织、存储和管理数据而建立在计算机存储设备上的...

  • Atlas调研

    简介 奇虎360的一个mysql数据库中间层项目 在mysql官方推出的mysql-proxy0.8.2的基础上改...

  • MySQL基础01-数据类型

    一、整数类型 每个整型类型可以指定一个最小显示宽度(注意:这个宽度并不表示存储的值有多大) 注:如果有指定UNSI...

  • MySQL应用技术4 — 数据类型选择

    MySQL应用技术1 — MySQL架构简介MySQL应用技术2 — 事务简介MySQL应用技术3 — MVCC ...

  • MySQL应用技术6 — 数据库中的锁

    MySQL应用技术1 — MySQL架构简介MySQL应用技术2 — 事务简介MySQL应用技术3 — MVCCM...

  • MySQL应用技术5 — 约束与范式

    MySQL应用技术1 — MySQL架构简介MySQL应用技术2 — 事务简介MySQL应用技术3 — MVCCM...

网友评论

      本文标题:MySQL基础01-简介

      本文链接:https://www.haomeiwen.com/subject/nrxrcrtx.html