MySql

Posted 不言

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySql相关的知识,希望对你有一定的参考价值。

mysql压缩包安装3.7版本

第一步:

  将MySql解压路径,即安装目录(例如:F:\\MySql\\mysql-5.7.20-winx64)配置到系统变量,

新建MYSQL_HOME : F:\\MySql\\mysql-5.7.20-winx64;

将配置好的MYSQL_HOME配置到path中 path : %MYSQL_HOME%\\bin;

第二步:

  在安装目录中配置my.ini文件

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It\'s a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]
explicit_defaults_for_timestamp = true
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = F:\\MySql\\mysql-5.7.20-winx64
# datadir = F:\\MySql\\mysql-5.7.20-winx64\\data
# server_id = .....
# 绑定IPv4和3306端口 
 bind-address = 0.0.0.0
 port =3306 
 max_connections=200

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

  文件中的安装路径需要自己修改 basedir、datadir

第三步:

  以管理员的权限打开CMD,

  mysqld --install MySQL  安装MySQL

  net start MySQL  开启MySQL 成功显示“服务已启动成功”;

第四步:

  启动MySQL并修改密码

       在CMD控制台里执行命令  mysql -u root -p 

  回车执行后,输入刚才记录的随机密码

  执行成功后,控制台显示 mysql>,则表示进入mysql

  输入命令set password for root@localhost = password(\'123\'); (注意分号)

  此时root用户的密码修改为123

ps:我在安装过程中遇到一个错误

一开始我以为缺少这个文件,安装之后还是不行出现了其他错误

解决方案:缺少VC2013运行库,下载并安装解决此问题。

 

以上是关于MySql的主要内容,如果未能解决你的问题,请参考以下文章

从mysql的片段中加载ListView

连接MySQL出现错误:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)(代码片段

使用 json rereiver php mysql 在片段中填充列表视图

关于mysql驱动版本报错解决,Cause: com.mysql.jdbc.exceptions.jdbc4Unknown system variable ‘query_cache_size(代码片段

修改MySQL密码报错“ERROR 1819 (HY000): Your password does not satisfy the current policy requirements“(代码片段

mysql查看版本的四种方法