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.