mysql5.6 miananzhuangban installation configuration details Tutorial

First of all, today wrote a very simple j2ee program, all business logic is no problem, I double-checked Chinese garbled problems, and made me big head, I finally uninstalled the mysql installation, the re-configured, well . . . . . This time I want to anger. But still the problem solved, get the help of a giant, really grateful. Write a blog tomorrow, today said here at first.

If you first install ignore the following words

  • For reloading it (free installation) should stop the mysql service process in cmd command (administrator) in, sc query mysql query mysql
  • sc delete mysql delete mysql This time you open the mysql service, has no
    then you have to

1, mysql delete files (delete)
2, clean up the registry, under, path variables

About clean up the registry, please Baidu

===========================================
first installed

Unpack the archive to the directory you want to install the next, I was:

D:\Program Files (x86)\JavaEE\mysql

-1 Configuration

  • Open the configuration file in the installation directory

  • my-default.ini (copy) to modify a file called my.ini

  • Open the configuration file my-default.ini installation directory (copy) to modify a file called my.ini

  • With a text editor to open class, find the corresponding position of the basedir, remove the #

  • Add Path

    basedir = D:\Program Files (x86)\JavaEE\mysql\mysql-5.6.28-winx64
    datadir=D:\Program Files (x86)\JavaEE\mysql\mysql-5.6.28-winx64\data
    port = 3306

  • Note revise your directory


  • note:
  • No data folder in MySQL5.7.9, the need to generate data folder with these orders
  • 1) from the console into the MySQL extract the bin directory under the directory:
    2) Enter the service-installation command:
        1. mysqld --console
        2. mysqld  --initialize
        3. mysqld install 
3) 安装成功后会提示服务安装成功。

2. configuration environment variable path

  • Open the Control Panel> System and Security> System> Advanced System Settings> path variable (not to say)
    • Run as Administrator cmd, enter the MySQL bin directory, enter mysqld -install
  • After a successful installation will start the service net start mysql service started successfully!
  • After the service starts successfully, you can log in, and input mysql -uroot -p (first log on without a password, press the Enter directly over), log on success!

3 Set a password (optional, there is still relatively good)

  1. Mysql default root password after installation is empty

    Mysql -uroot to enter into mysql

    How to set the initial password go after it: mysql -uroot to enter into mysql

Set initial password go after it:

1, the implementation (note the semicolon sql statement)

use mysql ;
update user set password=password(“new_pass”) where user=“root”;
flush privileges;
exit ;

It can be.

2, set a new password with the same 1

3, forgotten passwords

Add [mysqld] In password authentication my.ini skip
skip-name-resolve and enter in cmd mysql -uroot directly
into, and then perform step 1

Reference http://blog.csdn.net/stypace/article/details/38232393

4 coded modify the default configuration.

Reference http://www.2cto.com/database/201504/394479.html

Open the my.ini file

  1. After When we extract the zip file format to the specified directory, and complete the basic configuration of the environment, open MySQL
    5.6.24 will find a file called my-default.ini [] of. We use Notepad to open the file and did not find [default-character-set = xxx] or [character_set_server = xxx], how it happened? Many online methods are given directly modify the sentence xxx is utf8, not urgent, please see the following Step two:
  2. Copy the file, and named my.ini [], there are two .ini files under this root directory, one is my-default.ini, is a my.ini then we only need to modify the inside of the my.ini content on the line. See Step Three:
  3. Modify my.ini []

In [mysqld] Add the following character_set_server = utf8, attention is [not] [utf8 utf8] punctuation and no later;
in [sql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES] three rows behind these words and then add

[client]
port=3306
default-character-set=utf8

4, after more than three steps ok. Save reboot the server, after landing at the command line, type:

show variables like 'char%';

Default character set can be viewed as shown below:

mysql> show variables like 'char%';
+--------------------------+-------------------------------------------------------------------------+
| Variable_name            | Value                                                                   |
+--------------------------+-------------------------------------------------------------------------+
| character_set_client     | utf8                                                                    |
| character_set_connection | utf8                                                                    |
| character_set_database   | utf8                                                                    |
| character_set_filesystem | binary                                                                  |
| character_set_results    | utf8                                                                    |
| character_set_server     | utf8                                                                    |
| character_set_system     | utf8                                                                    |
| character_sets_dir       | D:\Program Files (x86)\JavaEE\mysql\mysql-5.6.28-winx64\share\charsets\ |
+--------------------------+-------------------------------------------------------------------------+
8 rows in set (0.00 sec)

Open the my.ini file as follows: Total made the appropriate changes

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
 

[mysqld]
 

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
 
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
 


# These are commonly set, remove the # and set as required.
basedir = D:\mysql-5.6.24-winx64
datadir = D:\mysql-5.6.24-winx64\data
port = 3306
# server_id = .....
character_set_server=utf8


 
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
 
[client]
port=3306
default-character-set=utf8

The case sensitivity setting command line mysql

[mysqld]

lower_case_table_names=2

Turn on MySQL remote connections

use mysql

Use "the ON the GRANT ALL PRIVILEGES . The TO 'the root' @ '%' the IDENTIFIED BY 'the root' the WITH the GRANT the OPTION;" command to change the settings of the remote connection.

flush privileges;

select host,user from user;

It is necessary to modify the host of%, any IP address can log on.

Or by
navicat modifying
[image dump outer link fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-m6A3Juuc-1574753014946) ( https://ooo.0o0.ooo/2017/06/22 /594b2d4ab1406.png)]

mysql> update user set host = ‘%’ where user = ‘root’;

After the implementation of error may be prompted to re mysql> select host, user from user;. View under the bar.

root corresponding host became%, represents any IP address logged.

http://www.2cto.com/database/201505/399280.html

Published 175 original articles · won praise 76 · Views 230,000 +

Guess you like

Origin blog.csdn.net/qq_29232943/article/details/52755965