installation of mysql database

MySQL is a relational database management system , divided into community edition and commercial edition, with the advantages of small size, fast speed, low cost, and open source.
MySQL official website provides Installer (installation) version and Archive (document) version, two types of installation packages. The Installer installation package supports the installation of X86 and X64 systems respectively, while the Archive version X86 and X64 need to be downloaded and installed separately. Since the developed applications will be installed on X86 and X64 systems, it is recommended to use the Installer version of MySQL. Of course, you can install either Installer or Archive in actual use.
MySQL software download
MySQL Installer Download 
mysql-installer-community-5.7.19.0.msi: https://dev.mysql.com/downloads/file/?id=471661
MySQL Archive Download 
Install
Type mysql in the start menu
Click on mysql and the following figure will pop up
click add


The following problems occur during the installation process
问题原因大体是mysql自动安装的Visual C++ Redistributable 路径不对或者即使是x64的mysql识别的也是x86的安装路径,所以解决方案是从微软手动下载 Visual C++ Redistributable安装 ,简体中文微软官方下载路径为: https://www.microsoft.com/zh-CN/download/details.aspx?id=40784  ,点击下载按钮并将vcredist_x64和vcredist_86都下载下来,先安装vcredist_x64后尝试重新安装mysql 5.7.20 ,假如依然报错,然后安装vcredist_x86后再次安装mysql 问题解决。











安装完成
配置环境变量
1、找到mysql的安装路径:C:\Program Files (x86)\MySQL\MySQL Server 5.7\bin
2、 新建MYSQL_HOME变量,并配置
3、 编辑path系统变量,将%MYSQL_HOME%\bin添加到path变量后
测试是否安装成功
进入mysql的安装路径:
C:\Program Files (x86)\MySQL\MySQL Server 5.7\bin
输入net stop mysql57,停止mysql服务
输入net start mysql57,启动服务
连接数据库:输入mysql -u root -p
输入密码:******
登录成功
输入show databases;查询数据库
create database travel;创建travel数据库
drop database travel;删除数据库
use travel;使用数据库
执行完使用数据库命令后,就可以对该数据库进行创建、修改、插入、删除表等操作,
使用sqlyong远程连接数据库时,出现如下类似的错误( https://blog.csdn.net/zxyvb/article/details/2462514
ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL 
解决办法:
1、改表法:(可能是你的账号不允许远程登录,只能用localhost登录。在localhost那台电脑登录mysql,更改mysql数据库里的“user”表里的host选项,把“localhost”改成“%”)
进入mysql后,输入usr mysql使用表;
show tables; 判断表是否存在
输入 update user set host='%' where user='root';
2、如果你想 myuser使用 mypassword从任何主机连接到mysql服务器的话
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324859189&siteId=291194637