Note: Refer to the official website documentation
MySQL decompression version of the installation configuration is broadly divided into the following 6 steps:
Extract The main archive to the desired install directory
Optional: Also extract the Debug-test archive if you plan to execute the MySQL benchmark and test suite
Create an option file
Choose a MySQL server type
Initialize MySQL
Start the MySQL server
Secure The Default user accounts
1. Download the MySQL installation package, unzip the installation package
2. Create a MySQL boot item configuration file
The first method: each time you start MySQL, you can manually configure the startup item in the CLI
The second method: Create Profile My.ini, MySQL automatically reads the configuration information each time it starts (obviously this method is more convenient)
Assuming the MySQL installation location is E:\mysql, the data directory:E:\mydata\data。那么在my.ini文件中的[mysqld]部分配置 basedir
和 datadir
两个可选配置项。具体内容如下(windows operation system):
[mysqld]# set Basedir to your installation pathbasedir=e:\\mysql# set DataDir to the location of your data Directorydatadi R=e:\\mydata\\data
3. Set MySQL server storage engine (can not be set, default is InnoDB)
Method One, the default storage engine can be specified by the--default-storage-engine feature option when MySQL is started. (--C)
Method Two, in the configuration file My.ini [mysqld] section set to increase the default storage engine settings. :
[Mysqld]
--default-storage-engine
4. Initialize MySQL
After the MySQL 5.7.6 release, the extract version of the program directory no longer contains the data directory, we need to use the--initialize or--initialize-insecure feature options to generate the data directory and system tables.
bin/mysqld --defaults-file=E:\mysql\my.ini --initialize 【说明:】
bin/mysqld --defaults-file=E:
\mysql
【说明:】
命令执行过程如下:
1.检查 data目录 是否存在. if exist:命令行报错,只需将data目录 删除,再执行命令即可 if not exist:创建新的data目录
2.在data目录创建mysql系统数据库[其中包括:系统帮助
table
, Authorization table, time zone table]
3. The server initializes the INNODDB System tablespace and table structure required for database engine management
4. The server creates a ' root ' @ ' localhost ' for the client program.
If you use
--initialize feature option, the server generates a random password and outputs it to the console interface
If you use the--initialize-secure feature option, the created Superuser password is blank (the console will give you a hint)
5. For server-side help Table Fill information
6. Server program (MYSQLD) fallback out
5. Start the MySQL service
Method One: Start the service from the command line The command line interface can display the running status information of MySQL in real time, and it is more convenient to debug and modify the Run failure "
Open service Command: Mysqld--console
Method Two: Register as Windows system service and start the MySQL service through system service. br> If the service is running at this time, you should stop the service and use the command: mysqladmin-u root-p shutdown
After the service is stopped, register MySQL as a system service by using the command: Mysqld--install. While registering the service, you can use the option--default-file to set/modify the location of the My.ini configuration file.
For example: mysqld--install MySQL--defaults-file=c:\my-opts.ini
Note: [
mysqld --install 注册的服务是开机自动启动,要设置为手动启动 使用命令:--install-manual ]
[使用 mysqld --remove 命令删除命令]
注册成功之后,我们可以从windows管理工具来启动/开闭mysql服务,也可以在命令行界面通过使用 net start mysql、net stop mysql 命令来启动/关闭myslq服务。
6.登录mysql客户端并修改用户密码:
登录命令: mysql -uroot -hlocalhost -p -P3306
修改密码命令:alter user‘root‘@‘localhost‘ identified by ‘new_password‘
mysql5.7 installing MySQL on Microsoft Windows Using a noinstall Zip Archive (MySQL decompression version installed)