Ubuntu16 compilation and installation of mysql5.7 and ubuntu16mysql5.7

Source: Internet
Author: User

Ubuntu16 compilation and installation of mysql5.7 and ubuntu16mysql5.7

Installation environment:

Linux: ubuntu-16.04.3-desktop-amd64

Mysql version: mysql-boost-5.7.20.tar.gz

: Https://dev.mysql.com/downloads/mysql/

----------------------------------------------------------------------------------

Preparations before mysql installation:

1. Install the cmake Tool

Sudo apt-get install cmake-y

2. Install the Compiler

Sudo apt-get install gcc g ++-y

3. Install the graphics library

Sudo apt-get install libncurses5 libncurses5-dev-y

4. Start compilation and installation:

1. Compilation parameters:

Cmake.-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DSYSCONFDIR =/etc-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = export-success =/usr/local/mysql/data-DWITH_BOOST = boost

2. install (make & make install)

 

After installation:

Bytes --------------------------------------------------------------------------------------------------------------

View the cnf configuration file. Generally, mysql will go to these three places to find the configuration file:

/Etc/mysql/my. cnf/etc/my. cnf ~ /. My. cnf

Search from left to right, find and stop

1. Next, copy the configuration file to the/etc or/etc/mysql directory (or create it yourself:

The configuration is as follows:

[client]port = 3306socket = /usr/local/mysql/data/mysql.sock[mysqld]port = 3306socket = /usr/local/mysql/data/mysql.sockbasedir = /usr/local/mysqldatadir  = /usr/local/mysql/data

2. Modify the group and owner of my. cnf.

Chown ghostwu: ghostwu my. cnf

 

3. Go to the installation directory:/usr/local/mysql/bin. After the data Initialization is executed, a default password will be generated [required for the First Login]

./Mysqld -- initialize -- user = ghostwu -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data/

 

 

4. Now you can start mysql.

5. log on to mysql with the password generated during initialization

6. modify the current user password:

7. Stop the mysql process:

./Mysqladmin-u root-pabc123 shutdown

8. Restart mysql and log on with the new password abc123.

 

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.