Quick Installation and Deployment Method of Mysql in Windows System (Green Installation Free Version)

  • 2021-08-21 21:43:46
  • OfStack

The first thing to download MySQL is the green installation-free version, which can be put in any folder. This time, I put it directly on C disk

Steps:

1. Copy my-default. ini (ini without suffix is my-default) and rename it my. ini (ini without suffix is my), and then copy the following contents to replace all the original contents


[mysql]
default-character-set=utf8
[mysqld]
# Settings 3306 Port 
port=3306
# System basic directory  
basedir=C:/mysql-5.6
# User data directory  
datadir=C:/mysql-5.6/data
# The character set used by the server defaults to 8 Bit coded latin1 Character set 
character-set-server=utf8
#  Default storage engine to be used when creating new tables 
default-storage-engine=INNODB
------------------ Copy to this point above 

* Remember basedir And datadir Change to the location of the database 
* Files can be opened using Notepad 

2. MySQL Install Windows Service

(1) Installation

Locate the bin directory in the installation directory of mysql (shortcut key: hold down shift in this directory, right-click and select open command line here) and execute mysqld install

Enter commands in the cmd window “mysqld �install”


C:\mysql-5.6\bin> mysqld  In fact, in fact, the install

Installation of windows service Service successfully installed was successful.

***** If Install/Remove of the Service Denied! That's because the current permissions are insufficient

On the Start menu of Windows10 system, click the right mouse button. In the menu that appears at this time, we select Command Prompt (Administrator), click Open and then execute the above command.

However, you should type "cd C:\ mysql-5. 6\ bin" to go to this folder

(2) Start the MySQL service

Enter commands in the cmd window “net start MySQL”


C:\mysql-5.6\bin> net start MySQL

Shows: MySQL service is starting.

The MySQL service has started successfully.

(3) Change the password

(Shortcut key: Hold down shift in the bin directory and right-click to open command line here)


bin>mysql -u root, Enter mysql
Enter password: ******
set password for root@localhost = password('root');

If Query OK is displayed, the modification is successful

Then exit exits

3. Mysql allows remote access to other computers

Enter commands in the cmd window “mysql -u root -p” And enter the password


 Enter mysql> Enter the command after " GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; " 

Related articles: