Installation of database--mysql

Source: Internet
Author: User

"Reprint link" MySQL-5.6.24 free installation version of the configuration method, the need for friends can refer to the next.

1. Download MySQL Community Server 5.6.24

2. Unzip the MySQL archive package

Unzip the downloaded MySQL package into a custom directory, and my unzip directory is:

"C:\mysql"

Will unzip the directory under the default file My-default.ini copy one copy, renamed My.ini

Copy the following configuration information to My.ini save

#如果没有my-default.ini, you can create your own my.ini or get it from somewhere else.

#########################################################

[Mysqld]
#绑定IPv4和3306端口
Bind-address = 0.0.0.0
Port = 3306

# Set the installation directory for MySQL, where you unzipped the installation package
Basedir=c:/mysql


#需要注意到的是这里是斜杠 "/" instead of the backslash ' \ ' in Windows

# Set up a storage directory for MySQL database data
Datadir=c:/mysql/data

# Maximum number of connections allowed
max_connections=200

#设置字符集为utf8
Loose-default-character-set = UTF8

#开启查询缓存
Explicit_defaults_for_timestamp=true

Sql_mode=no_engine_substitution,strict_trans_tables


[Client]

#设置客户端字符集

port=3306
Loose-default-character-set = UTF8

[Winmysqladmin]

Server = C:/mysql/bin/mysqld.exe
#########################################################

3. Add Environment variables

The operation is as follows:
1) Right-click My Computer, properties, advanced system settings (advanced), environment variables
Click the New button under System variables
Input variable name: mysql_home
Input variable Value: C:\mysql
#即为mysql的自定义解压目录.

2) Select path in the system variable
Click the Edit button
To add a variable value to a variable value:%mysql_home%\bin
Note that this variable is added after the value of the original variable, separated from it, and cannot delete the original variable value.

4. Registering MySQL as a Windows system service

Note: The operation is run as administrator at the command prompt

However, if you do not open a command prompt as an administrator, you will be prompted when you execute the above command: Install/remove
of the service denied! (Service installation is denied)

1) from the console into the bin directory under the MySQL decompression directory:
2) Enter the Service installation command:

Mysqld Install MySQL--defaults-file= "C:\my.ini"

Windows will start the mysqld command under "C:\Program Files\mysql\mysql-5.6.13-win32\bin" by default, and you will need to modify the MySQL service ImagePath in the registry to "C:\mysql\bin \mysqld "
--defaults-file=c:\mysql\my.ini MySQL

#解压目录下修改的my. ini file

A successful installation will prompt the service to install successfully.

#注: The My.ini file is placed in the root directory after MySQL decompression

#移除服务命令为: Mysqld Remove

Mysql

5. Start the MySQL service off

Note: The operation is run as administrator at the command prompt


Method One:

The Start service command is: net start MySQL

Shutdown Service Command for: net stop MySQL


Method Two:
Open the Administration Tools service and locate the MySQL service.
Start the service by right-clicking to start or by tapping on the left-hand boot directly.

6. Change the password of the root account


The default password for the root account is empty when the installation is complete, and you can modify the password to the specified password. Example: 123456
C:>mysql–uroot
Mysql>show databases;
Mysql>use MySQL;
Mysql>update user SET Password=password ("123456") WHERE user= ' root ';
Mysql>flush privileges;
Mysql>quit

7. mysql Console shortcut established:

1) object location input, new shortcut, right-click, Desktop: C:\Windows\System32\cmd.exe

Shortcut name self-defined, OK, shortcut established successfully

2) Right-click the shortcut you just created, and then change the target column to the MySQL startup parameter:

C:\Windows\System32\cmd.exe "C:\mysql\bin"/k mysql-u root-p Admin

Explanation: cmd path "mysql Path bin directory"/k mysql-u user name-p password database name

3) Click OK to save after the modification, double click the shortcut to connect to MySQL database

Installation of database--mysql

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.