MySQL的安装:
在官网下载https://dev.mysql.com/downloads/windows/installer/5.7.html



MySQL的window系统下安装
选择接受协议

选择默认项

选择一个项,然后点击下面的check,如果某个产品你不会用到,不安装额外软件的话可以继续MySQL。
如果有些产品你不需要用的话,不需要安装额外软件,直接点next就可以了。会弹出一个窗口,忽略它,直接点击yes就可以。

选择Excute,然后等待安装完成,直接一直点next

1.有三个使用类型,开发者,服务器,网络专用服务器。
2.根据个人需求选择,如果是个人,一般选择开发者就可以了。

1.上面是设置最高权限的密码,这个密码很重要,务必设置一个不容易被破解的。
2.下面是用户设置,这个在以后添加删除用户也是可以了,安装的时候可以忽略。
3.然后点下一步。

接下来的是window系统服务和插件扩展的选项,剩下的都是一些检查或者开启状态之类的,按着默认一直点下一步可以了。

选择next

选择execute


选择next

选择check,然后next

选择execute



MYSQL数据库的安装
启动服务
在进行MySQL配置过程中,设置window选项时若选择将MySQL安装为windows的服务。可依次双击【我的电脑】|【控制面板】|【管理工具】|【服务】,在【服务】窗口中双击【MySQL】服务,在弹出的对话框中可单机【启动】按键启动MySQL服务器。

MySQL数据库安装
安装MySQL后,在开始菜单中依次选择“所有程序”-MySQL-MySQL server 5.7-MySQL 5.7 command line client,可以打开MySQL命令行工具。首先要求用户输入管理员用户root的密码,按下回车。
MySQL>是MySQL命令行工具的提示符,可以在它后面输入命令。

退出MySQL数据库
-quit
查看版本
MySQL>select version();

MySQL服务器在安装后默认创建了information_schema,mysql,performance_schema,sakila,sys,world六个数据库。
MySQL>show databases;

使用use命令切换SQL语句作用的数据库,
MySQL>use mysql;

用于显示数据库中的表信息
MySQL>show tables;

查看具体的表结构,
mysql>describe tablename;

mysql字符集

查看MySQL数据表(table)的MySQL字符集
MySQL>show table status from MYSQLlike'%slave%',

看MySQL数据列(column)的MySQL字符集
MySQL>show full columns from user;


mysql中还可以使用MySQL的命令:“set names connection”和character_set_results的字符集为gbk。

网友评论