MySQL 基础
MySQL 由瑞典MySQL AB公司开发,目前被oracle公司收购。
开源、关系型数据库管理系统
MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
版本分为【社区版】和【企业版(商业版)】
LAMP 环境:Linux + Apache + MySQL + PHP,一组常用来搭建动态网站或者服务器的开源软件
官网及下载地址:https://www.mysql.com/
MySQL 安装
安装方式分为:MSI安装(Windows installer)、ZIP安装
下载之前需要登录
mysql-installer-community-5.7.18.1.msi
MD5: 3c4bfbc433c78fc082093d29c73beeb6
Size: 405.8M
MySQL 配置
在 cmd 中输入 mysql,提示【’mysql’ 不是内部或外部命令,也不是可运行的程序
或批处理文件】
只需将MySQL安装路径添加系统环境变量即可。
环境变量中编辑系统变量Path,添加如下路径,最后,在 cmd 中输入 mysql 检测。
;C:\Program Files\MySQL\MySQL Server 5.7\bin
mysql ERROR 1045 (28000): 错误解决办法
进入 MySQL
C:\Users\bxm09>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.7.18-log MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
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 版本信息
mysql> status
--------------
mysql Ver 14.14 Distrib 5.7.18, for Win64 (x86_64)
Connection id: 11
Current database:
Current user: ODBC@
SSL: Not in use
Using delimiter: ;
Server version: 5.7.18-log MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: gbk
Conn. characterset: gbk
TCP port: 3306
Uptime: 41 min 32 sec
Threads: 1 Questions: 24 Slow queries: 0 Opens: 100 Flush tables: 1 Open tables: 95 Queries per second avg: 0.009
--------------
显示数据库
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| sys |
| world |
+--------------------+
6 rows in set (0.01 sec)
退出 MySQL
mysql> exit
Bye