surroundings:
ubuntu18.04.2
mysql5.7.21
# Create mysql is a group groupadd mysql useradd -g mysql mysql # View is a group tail /etc/passwd # Create mysql frequently used folders in the / usr / Locle mkdir mysql mkdir boost mkdir -p /data/mysql # Affiliated group chown -R mysql:mysql /data/mysql chown -R mysql:mysql mysql # Decompression boost tar -xvf boost_1_59_0.tar.gz mv */usr/local/boost Download dependencies # apt-get install make cmake gcc g++ bison libncurses5-dev build-essential # Decompression mysql tar - xvf mysql - of 5.7 . 21 And targz cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/ -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DMYSQL_USER=mysql -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost # - DCMAKE_INSTALL_PREFIX to install the software directory # - Path DMYSQL_DATADIR data file storage # - DSYSCONFDIR configuration file path (my.cnf) # - DENABLED_LOCAL_INFILE = . 1 using the client configuration localmysql # - DWITH_PARTITION_STORAGE_ENGINE the points table mysql support # - character set DEXTRA_CHARSETS installation support # - DDEFAULT_CHARSET default character set used here configured as UTF - . 8 # - DDEFAULT_COLLATION connection character set # - DWITH_SSL open ssl use the mysql make && make install #ysql execute commands added to the system environment variables echo "export PATH=$PATH:/usr/local/mysql/bin" >>/etc/profile source /etc/profile # Set my.cnf we / etc / my.cnf [mysqld] datadir = /data/mysql socket = /usr/local/mysql/mysql.sock pid-file = /usr/local/mysql/mysql.pid log_error = /data/mysql/mysql-error.log # Installation directory, initialization cd /usr/local/mysql/bin . / Mysqld - the initialize --basedir --user = mysql = / usr / local / mysql / --datadir = / the Data / mysql / # start mysql service cd /usr/local/mysql/support-files ./mysql.server start # Initialization is complete Please note that the information will be prompted to print a temporary password for the root user (last line); #change Password the SET password for root @localhost = password ( ' 123456 ' );
# mysql so far has been completely compiled and installed successfully
mysql -uroot -p
--- end --- restore content