1、默认安装后需要配置mysql环境变量
变量名任意值
变量值:mysql安装路径\bin
如果不设置环境变量,doc命令如果没切换到正确路径可能找不到mysql相关命令
2、安装完成后如果远程连接被拒绝
方法一:
改表法
mysql -u root -p
mysql;use mysql;
mysql;select 'host' from user where user='root';
mysql;update user set host = '%' where user ='root';
mysql;flush privileges;
mysql;select 'host' from user where user='root';
方法二
授权法
mysql -u root -p;
mysql GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;
mysql flush privileges;
3、查看mysql字符集
show variables like '%char%';
4 mysql初始化启动.ini配置样本
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/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]
# 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 = "E:\mysql-5.7.18-winx64"
#数据存放目录
# datadir = "E:\mysql-5.7.18-winx64\data"
# port = .....默认端口 3306
# server_id = ..... 服务实例的唯一标示
# 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
#服务端编码方式
character-set-server=utf8
[client]
loose-default-character-set=utf8
[WinMysqladmin]
Server="E:\mysql-5.7.18-winx64\bin\mysqld.exe"
5、执行mysql初始化sql脚本实例
source 本地sql脚本绝对路径
如:source c:\init.sql;
变量名任意值
变量值:mysql安装路径\bin
如果不设置环境变量,doc命令如果没切换到正确路径可能找不到mysql相关命令
2、安装完成后如果远程连接被拒绝
方法一:
改表法
mysql -u root -p
mysql;use mysql;
mysql;select 'host' from user where user='root';
mysql;update user set host = '%' where user ='root';
mysql;flush privileges;
mysql;select 'host' from user where user='root';
方法二
授权法
mysql -u root -p;
mysql GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;
mysql flush privileges;
3、查看mysql字符集
show variables like '%char%';
4 mysql初始化启动.ini配置样本
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/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]
# 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 = "E:\mysql-5.7.18-winx64"
#数据存放目录
# datadir = "E:\mysql-5.7.18-winx64\data"
# port = .....默认端口 3306
# server_id = ..... 服务实例的唯一标示
# 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
#服务端编码方式
character-set-server=utf8
[client]
loose-default-character-set=utf8
[WinMysqladmin]
Server="E:\mysql-5.7.18-winx64\bin\mysqld.exe"
5、执行mysql初始化sql脚本实例
source 本地sql脚本绝对路径
如:source c:\init.sql;