Get the App
SLTechnology News&Howtos  ›  Database  › 

Source code compilation and installation of mysql-5.7.14

Shulou Source: shulou.com Published: 2022-06-01 12:53:03 10月01日 Update

1. Download and upload mysql-5.7.14.tar.gz view plain copy

tar -zxf msql-5.7.14.tar.gz

2. Install dependency package view plain copy

yum -y install gcc gcc-c++ ncurses ncurses-devel cmake

3. Download Boost library view plain copy

wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz

4. Add user view plain copy

groupadd mysql

useradd -r -g mysql -s /bin/false mysql

5. view plain copy

cmake . \

-DCMAKE_INSTALL_PREFIX=/application/mysql-5.7.14 \

-DMYSQL_DATADIR=/application/mysql-5.7.14/data \

-DDOWNLOAD_BOOST=1 \

-DWITH_BOOST=/software/boost_1_59_0 \

-DMYSQL_UNIX_ADDR=/application/mysql-5.7.14/tmp/mysql.sock \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DENABLED_LOCAL_INFILE=ON \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DWITH_FEDERATED_STORAGE_ENGINE=1 \

-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \

-DWITHOUT_PARTITION_STORAGE_ENGINE=1 \

-DWITH_FAST_MUTEXES=1 \

-DWITH_ZLIB=bundled \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_READLINE=1 \

-DWITH_EMBEDDED_SERVER=1 \

-DWITH_DEBUG=0

6. view plain copy

make

make install

7. modify/etc/my.cnf view plain copy

[mysqld]

datadir=/application/mysql/data

socket=/application/mysql/tmp/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

character_set_server=utf8

8. modify permissions view plain copy

chown -R mysql:mysql mysql-5.7.14/

9. Create database directory view plain copy

mkdir data

chown mysql:mysql data

10. Initialize view plain copy

bin/mysqld --initialize --user=mysql --basedir=/application/mysql --datadir=/application/mysql/data

11. Set encrypted connection view plain copy

bin/mysql_ssl_rsa_setup

12. Join System Services view plain copy

cp support-files/mysql.server /etc/init.d/mysqld

Modify the basedir datadir attribute in mysqld file

chkconfig mysqld on #Set boot to boot

chkconfig --list | grep mysqld

13. Start Restart Stop View Plain Copy

service mysqld start

service mysqld restart

service mysqld stop

14. Log in and change the initial password copy

SET PASSWORD FOR 'root'@'localhost'=PASSWORD('newpassword');

Problems encountered during installation view pcopy

Starting MySQL... ERROR! The server quit without updating PID file (/application/mysql/Rong.pid).

1. The requested URL/var/log/mysqld.log was not found on this server.

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

2. Reason: When initializing the database permission table, the permission table created by default is under the default directory/usr/local/mysql/var, but actually it is in/application/mysql/data.

3. To solve the problem, change the--datadir parameter under/etc/my.cnf

Tags: Permissions compilations reasons data databases directories errors problems parameters actual passwords properties files logs time user system encryption service Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information NVidia OPPO Reno Microsoft Shulou Tech Info