官网下载地址。MySQL有企业版和社区版,将标签页切换到Community(社区版)。左侧包含各种系统的MySQL的下载地址、工作空间(WorkBench)、编程接口(Connectors)等。如果想下载非安装版的,在左侧标签页中选择“MySQL Community Server”,其中的下载都是解压版的。
MySQL5.7.13安装过程中的一些体会
- 将空密码设置自己的密码
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
- 连接本地数据库
mysql -hlocalhost -uroot -p
- win下启动、停止mysql服务
net stop mysql
net start mysql
- 设置mysql缓存,参考官方文档,查看缓存配置情况语句
show variables like '%query_cache%'
sql语句的执行顺序,参见博客
利用Navicat导入、导出数据库,参照百度经验
常用的显示命令
- 显示数据库列表。
show databases; - 显示库中的数据表:
use databasename;
show tables; - 显示数据表的结构:
describe 表名; - 建库:
create database 库名; - 建表:
use 库名;
create table 表名 (字段设定列表); - 删库和删表:
drop database 库名;
drop table 表名; - 将表中记录清空:
delete from 表名; - 查看服务器版本、默认编码方式、端口等概要信息
status; - 查看创建表命令
show create table 表名;
- 显示数据库列表。