MySQL学习笔记(一)排版工整炒鸡详细你值得拥有

这篇博客是MySQL学习笔记的第一部分,涵盖了数据库的基本概念、MySQL的特点、安装过程、启动与停止方法,以及配置文件my.ini的详解。此外,还介绍了如何登录和退出MySQL服务端,查看版本信息,以及SQL的查询语言基础。博主分享了Navicat Premium的下载、激活和使用遇到的问题,以及DQL数据查询语言的基础和条件查询操作。
摘要由CSDN通过智能技术生成

MySQL学习笔记(一)

by 呆萌同学

一、数据库的相关概念

1. DB
 数据库(Database):存储数据的“仓库”。它保存了一系列有组织的数据。
2. DBMS
 数据库管理系统(Database Management System)。数据库是通过DBMS创建和操作的。
 常见的DBMS:MySQL、Oracle(甲骨文)、DB2(IBM)、SqlServer(微软)等。
3. SQL
 结构化查询语言(Structure Query Language):专门用来与数据库通信的语言。
 几乎所有DBMS都支持SQL。

二、数据库存储特点
  1. 数据放入表中,表再放入库中。
  2. 一个数据库中可以有多个表,每个表都有一个名字用于标识自己,表名具有唯一性。
  3. 表具有一些特性,这些特性定义了数据在表中如何存储。
  4. 表由列组成,也称为字段。

三、MySQL数据库特点
  1. 隶属于MySQLAB公司,后被oracle收购。
  2. 成本低,性能高,安装和使用简单。
  3. 分社区版和企业版。

四、两类DBMS
  1. 基于共享文件系统的DBMS
    例如:Access
  2. 基于客户机——服务器的DBMS
    例如:MySQL、Oracle、SqlServer
    使用时既要安装客户端又要安装服务端。一般来说“安装”指安装服务端。

五、MySQL的安装

前往官网下载MySQL Community Server并安装:
https://dev.mysql.com/downloads/mysql

六、MySQL的启动与停止

windows:
 方法一:计算机-右击管理-服务
 方法二:命令行(以管理员身份方式运行):
  启动:net start 服务名
  停止:net stop 服务名
mac:
 进入系统偏好设置,找到MySQL打开,点击"Start MySQL Server",启动mysql;或点击"Stop MySQL Server",停止mysql

七、my.ini配置文件
  1. 服务端端口号 port=3306
  2. 安装目录 basedir
  3. 文件存储目录 datadir
  4. 字符集 character-set-server=utf8
  5. 存储引擎(用来执行SQL语句) default-storage-engine=INNODB
  6. 语法模式 sql-mode=“STRICT_TRANS_TABLES, NO_AUTO_CREATE)USER, NO_ENGINE_SUBSTITUTION”
  7. 最大连接数 max_connections=100

八、MySQL服务端的登陆和退出

首先保证MySQL为启动状态。
windows:
 在命令行输入

mysql [-h localhost -P 3306] -u root -p   //[ ]内的内容可以省略

回车后输入密码进入,输入exit退出
mac:
 在终端输入

mysql [-h localhost -P 3306] -u root -p   //[ ]内的内容可以省略

回车后输入密码进入,输入exit退出

九、查看MySQL版本

方法一:终端或命令行登陆MySQL,然后输入

select version();

SQL代码美化程序 SQL Pretty Printer 3.2.8 Copyright 2005-2011, Gudu Software. All Rights Reserved http://www.dpriver.com -------------------------------------------------------- Overview -------- SQL Pretty Printer is a tool that will help you beautify your SQL code. Using hotkey functionality, SQL Pretty Printer can reformat SQL statements for a wide variety of database tools such as Microsoft Query Analyzer, SQL Server Management Studio (SSMS), TOAD and PL/SQL Developer, development environments such as Visual Studio 2003/2005/2008 and Eclipse, and popular editors such as UltraEditor and EditPlus. In addition to beautifying SQL code, SQL Pretty Printer can translate SQL code into C#, Java, PHP, DELPHI and other program languages. SQL Pretty Printer also includes command line functionality, with the ability to format single files, single directories and multiple directories. SQL Pretty Printer is designed to deal with the syntax used by most popular database systems including Microsoft SQL Server, Oracle, IBM DB2, MySQL and Microsoft Access (Informix, Sybase, and PostgreSQL support is currently in development). Output conforms to most of the entry level SQL99 Standard. Add-Ins for SSMS and Visual Studio 2003/2005/2008/2011 are available. APIs for dotnet and COM version are available. features: ** Beautifies SQL statements utilizing highly customizable format options. ** Formats SQL on-the-fly in popular tools and editors using hotkey functionality. ** Minimizes to the system tray for quick access. ** Includes a command line for batch conversion of single files, single directories or directory trees (use the command line API in your own program!) ** Verifies SQL syntax with detailed error information. ** Converts monochrome SQL code into colorful RTF document. ** Converts monochrome SQL code into colorful HTML for easy placement in blogs and forums. ** Converts SQL to various programming languages including C#, Java, DELPHI, PHP and others. ** Currently supports SQL syntax for Microsoft SQL Server, Oracle, IBM DB2, MySQL and Microsoft Access (Informix, Sybase, and PostgreSQL support is currently in development). ** Add-In for SQL Server Management Studio available. ** Add-In for Visual Studio 2003/2005/2008 available. Requirements ------------ Pentium class CPU or higher Windows 95/98/NT/2000/XP/Vista/win7
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值