The most comprehensive mysql 5.7.13 installation and configuration method graphic tutorial (linux) is strongly recommended !, Mysql5.7.13

Source: Internet
Author: User
Tags localhost mysql mysql download

The most comprehensive mysql 5.7.13 installation and configuration method graphic tutorial (linux) is strongly recommended !, Mysql5.7.13

For your reference, the installation tutorial of Mysql 5.7.13 in linux is as follows:

1 system conventions
Installation File Download Directory:/data/software
Mysql directory installation path:/usr/local/mysql
Database storage location:/data/mysql
Log storage location:/data/log/mysql

2. Download mysql
On the official website: http://dev.mysql.com/downloads/mysql/, select the following version of mysql download:

Run the following name:
# Mkdir/data/software
# Cd/data/software
# Wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz

3. decompress the package to the target location.
# Mkdir/usr/local/mysql
# Cd/dat/software
# Pwd
The execution is as follows:

# Ls

# Cd/usr/local
# Pwd

# Tar-xzvf/data/software/mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz

# Ls

-- Modify file name
# Music mysql-5.7.13-linux-glibc2.5-x86_64 mysql
# Ls


4. Create a data warehouse directory
--/Data/mysql data WAREHOUSE directory
# Mkdir/data/mysql
# Ls/data/


5. Create a mysql user, group, and Directory
# --- Create an msyql Group
# Useradd-r-s/sbin/nologin-g mysql-d/usr/local/mysql --- create an msyql user to prohibit shell Login

6. Change the directory owner
# Cd/usr/local/mysql
# Pwd
# Chown-R mysql.
# Chgrp-R mysql.

# Chown-R mysql/data/mysql

7. configuration parameters
# Bin/mysqld -- initialize -- user = mysql -- basedir =/usr/local/mysql -- datadir =/data/mysql

Note the generated temporary password, as shown in the preceding figure: YLi> 7 ecpe; YP
# Bin/mysql_ssl_rsa_setup -- datadir =/data/mysql

8. Modify the System Configuration File

# Cp my-default.cnf/etc/my. cnf
# Cp mysql. server/etc/init. d/mysql

# Vim/etc/init. d/mysql
Modify the following content:

# Vim/etc/my. cnf
Modify the following content:

9 start mysql

# Bin/mysqld_safe -- user = mysql &

Bin/mysql -- user = root-p
-- Enter the temporary password generated in step 1


Mysql> set password = password ('a123456 ');

Mysql> grant all privileges on *. * to root @ '%' identified by 'a123456 ';
Mysql> flush privileges;

Mysql> use mysql;
Mysql> select host, user from user;

10 Add System Path
# Vim/etc/profile
Add:
Export PATH =/usr/local/mysql/bin: $ PATH
As follows:

# Source/etc/profile

11 configure mysql to start automatically
# Chmod 755/etc/init. d/mysql
# Chkconfig -- add mysql
# Chkconfig -- level 345 mysql on

The above is the first installation solution of Mysql 5.7.13 in linux. I hope it will be helpful for you to learn.

This article provides examples to share with you the installation tutorial of Linux mysql5.7.13 for your reference. The details are as follows:

1. Preparation
Cmake-3.6.0.tar.gz
Bison-3.0.4.tar.gz
Mysql-5.7.13.tar.gz (http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.13.tar.gz)

2. Install cmake and bison
First, check whether cmake is installed.

# rpm -qa |grep cmake # tar zxvf cmake-3.6.0.tar.gz# cd cmake-3.6.0# ./bootstrap# make && make install # tar zxvf bison-3.0.4.tar.gz# cd bison-3.0.4# ./configure# make && make install 

3. Install Mysql

[root@localhost src]# tar -zxvf mysql-5.7.13.tar.gz[root@localhost src]# cd mysql-5.7.13[root@localhost mysql-5.7.13]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=gbk -DDEFAULT_COLLATION=gbk_chinese_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1 ...CMake Error at cmake/boost.cmake:81 (MESSAGE): You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory> This CMake script will look for boost in <directory>. If it is not there, it will download and unpack it (in that directory) for you. If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80Call Stack (most recent call first): cmake/boost.cmake:238 (COULD_NOT_FIND_BOOST) CMakeLists.txt:451 (INCLUDE)-- Configuring incomplete, errors occurred!

Note:Refresh the configuration and delete the cmakecache.txt file.
Solution:
(1) Add the following options during pre-Compilation: cmake-DDOWNLOAD_BOOST = 1-DWITH_BOOST =/usr/local/boost
(2) download a boost package, put it in the/usr/local/boost directory, and add the option-DWITH_BOOST =/usr/local/boost

[root@localhost mysql-5.7.13]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=gbk -DDEFAULT_COLLATION=gbk_chinese_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost ....  CMake Error at cmake/readline.cmake:64 (MESSAGE): Curses library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel. Call Stack (most recent call first): cmake/readline.cmake:107 (FIND_CURSES) cmake/readline.cmake:181 (MYSQL_USE_BUNDLED_EDITLINE) CMakeLists.txt:479 (MYSQL_CHECK_EDITLINE) -- Configuring incomplete, errors occurred! See also "/usr/local/src/mysql-5.7.13/CMakeFiles/CMakeOutput.log". See also "/usr/local/src/mysql-5.7.13/CMakeFiles/CMakeError.log".

Solution:
(1) install ncurses-devel
Yum-y install ncurses-devel
(2)delete cmakecache.txt
Rm CMakeCache.txt
(3) re-run cmake
Copy codeThe Code is as follows: [root @ localhost mysql-5.7.13] # cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_UNIX_ADDR = mysql. mysql-DDEFAULT_CHARSET = gbk-DDEFAULT_COLLATION = gbk_chinese_ci-Hangzhou = 1-Hangzhou = 1-Hangzhou =/data/mysqldb-Hangzhou = 3306-DENABLE_DOWNLOADS = 1-DDOWNLOAD_BOOST = 1 -DWITH_BOOST =/usr/local/boost

Copy codeThe Code is as follows: [root @ localhost mysql-5.7.13] # make [root @ localhost mysql-5.7.13] # make install

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.