MYSQL installation and the database visualization navicat

Because you want to start trying to make java web project, it would need to use the database to interact, so we install mysql and navicat to get ready.
mysql installation reference blog: https://blog.csdn.net/qq_23994787/article/details/80648731

Step one: Download

mysql 5.7 Official Download: https://dev.mysql.com/downloads/mysql/5.7.html#downloads

Step two: Install

Downloaded is installed, due to the downloading of free installation, so the environment variable requires its own configuration files to be added;
environment variable configuration:
Right My Computer, click Properties.
Then click Advanced System Settings
Amassing click Advanced System Settings,
Here Insert Picture Description
this time you can see the environment variable settings. This time the need to system variables path column Add decompression mysql installation directory bin located under the directory, for example: C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin; Click Save; (be careful not to delete the path already exists the variables to be added in the back, otherwise there may be some software can not be used).
After you finish configuring the environment variables is to add a configuration file. (Not write the configuration file, so I'm using Xiaoxi configuration file (the original blog address: https://blog.csdn.net/qq_23994787/article/details/80648731)); configuration file to create a new txt text, the profile pasted in, save, and then modify a file called my.ini (ini name suffix)

# MySQL配置

[client]
# MySQL客户端端口
port=3306
[mysql]
# MySQL默认字符集编码
default-character-set=utf8
[mysqld]
# MySQL端口
port=3306
# MySQL安装路径
basedir="C:/Program Files/MySQL/MySQL Server 5.7/"
# MySQL数据库文件路径
datadir="C:/Program Files/MySQL/MySQL Server 5.7/data/"
# MySQL数据库默认编码
character-set-server=utf8
# 表存储引擎方式 INNODB与MyISAM两种
default-storage-engine=MyISAM
# SQL验证模式
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
# 最大连接数
max_connections=512
# MySQL查询缓存
query_cache_size=0
# 高速缓存的大小
table_cache=256
# 内存表的大小
tmp_table_size=18M

# 最大连接线程数
thread_cache_size=8
# 重建索引时所允许的最大临时文件的大小
myisam_max_sort_file_size=64G
# MyISAM表发生变化时重新排序所需的缓冲
myisam_sort_buffer_size=35M
# 索引缓冲区的大小
key_buffer_size=25M
# 内存缓冲区大小
read_buffer_size=64K
# 随机读缓冲区大小
read_rnd_buffer_size=256K
# 排序缓冲区大小
sort_buffer_size=256K


# InnoDB存储引擎用来存放数据字典信息以及一些内部数据结构的内存空间大小
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=47M
innodb_log_file_size=24M
innodb_thread_concurrency=8

log_bin=on

####################主从服务器配置##########################
# server-id=1             #数据库唯一ID,主从的标识号绝对不能重复。
# log-bin=mysql-bin       #开启bin-log,并指定文件目录和文件名前缀
# binlog-do-db=huanqiu    #需要同步的数据库。如果是多个同步库,就以此格式另写几行即可。如果不指明对某个具体库同步

,就去掉此行,表示同步所有库(除了ignore忽略的库)。
# binlog-ignore-db=mysql  #不同步mysql系统数据库。如果是多个不同步库,就以此格式另写几行;也可以在一行,中间逗号

隔开。
# sync_binlog = 1         #确保binlog日志写入后与硬盘同步
# binlog_checksum = none  #跳过现有的采用checksum的事件,mysql5.6.5以后的版本中binlog_checksum=crc32,而低版本都是

binlog_checksum=none
# binlog_format = mixed   #bin-log日志文件格式,设置为MIXED可以防止主键重复。
#############################################################

Then you can start to initialize the database;
Win7 users can type directly directly in the bin directory of mysql cmd to open;
win10 users will need to pay attention, simply type cmd in the Open because of insufficient privileges and installation services fail, therefore, need to open an administrator, and then type the installation directory operation;
type mysqld --initialize --user = mysql --console Enter, this operation will initialize the database, to create a new data file, at the same time generate a temporary password.
Here Insert Picture Description
The temporary password for the host after all characters are considered part of the password, a temporary password will appear at the end of the block.
Type mysqld --install install the service
and then use the command net start mysql start mysql service.
Because the service installation will take some time, so previous service may fail to start, wait a moment you can solve the problem.
After the password is modified;
Type mysql -uroot -p then enter the temporary password generated above,
Here Insert Picture Description
and then type the set password for root @ localhost = password ( 'root'); Enter, i.e. the root password to root. (You can set your own password and then parentheses, not necessarily as root)
here, mysql installation is over.

After the connection is simple navicat of.
Open navicat,
select the mysql connection. Here Insert Picture Description
And then type the password you set up, test the connection, if the display is connected successfully, that is, has been completed.
Here Insert Picture Description

Published 35 original articles · won praise 3 · Views 903

Guess you like

Origin blog.csdn.net/weixin_43823753/article/details/89761193