How to install MySQL 5.7.18 for Windows, mysql5.7.18

Source: Internet
Author: User

How to install MySQL 5.7.18 for Windows, mysql5.7.18

I. Installation Process

MySQL version: 5.7.18

1. Configure my. put the INI file (simple configuration) in the root directory of MySQL, and the file path configuration here must be an absolute path (use a backslash that requires double spelling and a slash) (the data folder does not need to be created by yourself and is generated later)

[Client] default-character-set = utf8 [mysqld] port = 3306character_set_server = utf8basedir = "D: \ mysql-5.7.18-winx64" datadir = "D: \ mysql-5.7.18-winx64 \ data "# the character set used by the server defaults to the 8-bit latin1 character set character-set-server = utf8 # The default storage engine default-storage will be used when creating a new table -engine = INNODB [WinMySQLAdmin] D: \\mysql-5.7.18-winx64 \ bin \ mysqld.exe


2. Configure the environment variable and configure the bin directory in Path.

3. initialize the database and generate the data folder and some configuration files (the default password for the root account will be generated after initialization: in the xx. err file)

Mysqld-initialize # err file example: [Note] A temporary password is generated for root @ localhost: w1BI/g/y. wfx

4. register the service

mysqld -install

5. Start MySQL

net start mysql

6. Log On after startup and enter the generated default password.

mysql -uroot -p

7. Change the account password

set password for root@localhost=password('root');

8. Stop the MySQL service.

net stop mysql

9 to delete the MySQL service, run the following command to delete it:

mysqld -remove

Ii. Post-Installation Problems

ONLY_FULL_GROUP_BY

SometimesError:

Com. mysql. jdbc. exceptions. jdbc4.MySQLSyntaxErrorException: Expression #2 of SELECT list is not in group by clause and contains nonaggregated column 'col _ user_6.a.START_TIME 'which is not functionally dependent on columns in group by clause; this is incompatible with SQL _mode = only_full_group_by

Cause: by default, the only_full_group_by mode is enabled for MySQL. This mode can only obtain information about fields affected by group by and cannot coexist with other fields not affected by group, or, you can only put the group by field at the top of the select keyword, which is limited.
Solution:

1) Direct SQL solution: this solution has some limitations, that is, when the database is restarted, The only_full_group_by mode will be started by default.

Copy codeCode: SET @ global. SQL _mode = 'strict _ TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION ';

2) permanent solution: In the my. ini file [mysqld], add the following conditions to filter out the only_full_group_by mode when MySQL starts.

Copy codeThe Code is as follows: SQL _mode = 'strict _ TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION'

Three Control Scripts

Finally, write a control script so that you can frequently use commands when using MySQL.

Cls @ echo off: Set the font color of the window color 0a: Set the TITLE of the window TITLE MySQL management program call: checkAdmingoto menu: menuclsecho. echo. =-select the MySQL operation-=-echo. echo.1: Start MySQLecho. echo.2: Disable MySQLecho. echo.3: restart MySQLecho. echo.4: return echo. echo. =-enter the project serial number you want to select-=-set/p id = if "% id %" = "1" goto startupif "% id %" = "2" goto shutdownif "% id %" = "3" goto rebootif "% id %" = "4" exitpause: start: startupecho. call: checkMySQL 1echo. MySQL......net start "MySQL" echo. MySQL started successfully! Pause goto menu: stop: shutdownecho. call: checkMySQL 2echo. Close MySQL......net stop "MySQL" echo. MySQL disabled successfully! Pause goto menu: restart: rebootecho. call: checkMySQL 2echo. Close MySQL......net stop "MySQL" echo. MySQL disabled successfully! Goto startupgoto menu: Exit: gooutpausegoto menu: Check whether the MySQL process exists: checkMySQLset/a count = 0for/f "tokens = 1 delims =" % I in ('tasklist/nh ^ | find/I "MySQL "') do (set/a count + = 1) if % count % neq 0 if "% 1" equ "1" (echo WARNING: MySQL has started goto goout) if % count % equ 0 if "% 1" equ "2" (echo WARNING: MySQL does not start goto goout): Check if running is as Administrator: checkAdminecho test am I admin?> % SystemRoot % \ System32 \ admin. hujunjieif not exist % SystemRoot % \ System32 \ admin. hujunjie (echo WARNING: Run as administrator! Pause exit) # xxxx can set del % SystemRoot % \ System32 \ admin. xxxx.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.