1. Preparation

  • Windows MySQL Green Edition
  • mac
  • Linux (centos, Ubuntu)

2. Install

2.1 Win Green Edition

  • Download website

  • Select the corresponding version (Windows (x86, 64-bit), ZIP Archive)

  • D:\db\mysql-5.7.19-winx64

  • The computer – > right – > properties – > advanced system Settings – > environment variables — > system — > the Path – > edit – > new – > fill in “D: \ db \ mysql – 5.7.19 – winx64 \ bin” – > confirmation

  • Configure the mysql. Ini

    [mysql]
    Mysql client default character set
    default-character-set=utf8
    [mysqld]
    Set port 3306
    port = 3306
    Set mysql installation directory
    basedir=D:/db/mysql-5.7.19-winx64
    Mysql > select * from 'mysql'
    datadir=D:/db/mysqldata
    # Maximum number of connections allowed
    max_connections=200
    The default character set used by the server is the 8-bit latin1 character set
    character-set-server=utf8
    The default storage engine to use when creating new tables
    default-storage-engine=INNODB
    Some problems with # Group by
    sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
    Copy the code
  • Open CMD (administrator) and go to the bin directory

  • Install the mysql service mysqld install

  • Initialize mysqld –initialize

  • Net start mysql

  • Datadir =C:/db/mysqldata

  • Open the. Err file and find the password after root@localhost

  • Mysql -uroot -p

  • Enter the password

  • ALTER USER “root”@”localhost” IDENTIFIED BY “123456”;

  • Error: Navicat for mysql

    • Terminal to enter mysql, enteruse mysql;
    • alter user 'root'@'localhost' identfied with mysql_native_password by '123456'
    • The refreshflush privileges

2.2 MAC

  • Choose how to install brewbrew install mysql
  • No password is required to log in
  • Change the passwordALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxx';

Linux 2.3 (centos7)

  • Yum list | grep mysql version (view)

  • Yum install -y mysql-server mysql mysql-deve

  • Service mysqld start Initialization

  • Mysqladmin -u root password ‘root’ set password

  • Setting up remote Connections

    mysql -u root -p show databases; use mysql; grant all privileges on *.* to 'root'@'%' identified by 'root'; # Grant privileges and password. # refreshCopy the code
  • Centos7 Run the preceding commands

    Service # mysql_secure_installationCopy the code

Linux 2.4 (ubuntu)

  • sudo apt-get install mysql-server
  • Passwords may appear during the download
  • sudo apt-get install mysql-client
  • sudo apt-get install libmysqlclient-dev
  • mysql -uroot -pLogin password is enough
  • The remote accesssudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
  • Comment out theThe bind - address = 127.0.0.1
  • The remote connection is the same as the above centos Settings
  • restartservice mysql restart

2.5 deepin

  • sudo apt-get install mysql-server mysql-client

  • sudo mysql -u root -p

  • Enter

  • UPDATE mysql.user SET authentication_string = PASSWORD('123'), plugin = 'mysql_native_password' WHERE User = 'root' AND Host = 'localhost';

  • FLUSH PRIVILEGES;

  • Sudo service mysql restart

Already includes Dc – Notes