Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install version 5.7-17-19 of mysql source code

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to install version 5.7-17-19 of the mysql source code. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Due to the needs of the project, we will now use version 5.7.19 of mysql.

1: download the mysql binary installation file first

Mysql-5.6.19.tar.gz

Storage directory / mysql/mysql-5.6.19.tar.gz

Tar-xf mysql-5.6.19.tar.gz

Cd mysql-5.6.19

Cmake, but it is suggested that the Cmake version is too low, at least 2.8is required

2: download cmake

Cmake-2.8.10.2.tar.gz

Tar-xf cmake-2.8.10.2.tar.gz

. / configure

Make & & make install

3: conduct cmake

First create the mysql installation directory and the data file storage directory

Mkdir-p / mysql/mysql

Mkdir-p / mysql/mysql/data

At the same time, you need to create a mysql account

Useradd mysql

Passwd mysql

Then do the directory authorization:

Chown-R mysql:mysql / mysql

This is the compilation and installation of version 5.7.17.

Cd mysql-5.6.17

Cmake\

-DCMAKE_INSTALL_PREFIX=/mysql/\ / / the root directory of the mysql software installation

-DMYSQL_DATADIR=/mysql/data\ / / mysql data file storage directory

-DSYSCONFDIR=/etc\ / / mysql configuration file (my.cnf) directory

-DWITH_MYISAM_STORAGE_ENGINE=1\ / / Storage engine options

-DWITH_INNOBASE_STORAGE_ENGINE=1\ / / to enable InnoDB, engine support:

-DWITH_MEMORY_STORAGE_ENGINE=1\

-DWITH_READLINE=1\

-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock\

-DMYSQL_TCP_PORT=3306\

-DENABLED_LOCAL_INFILE=1\ / / enable loading of local data

-DWITH_PARTITION_STORAGE_ENGINE=1\

-DEXTRA_CHARSETS=all\

-DDEFAULT_CHARSET=utf8\ / / default character set

-DDEFAULT_COLLATION=utf8_general_ci / / character set proofreading

To compile, the compilation times error is as follows:

Heck size of wctype_t-done

-- Check size of wint_t

-- Check size of wint_t-done

-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)

CMake Error at cmake/readline.cmake:85 (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:128 (FIND_CURSES)

Cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)

CMakeLists.txt:411 (MYSQL_CHECK_EDITLINE)

This error indicates that the ncurses-devel dependency package is missing

Download: ncurses-devel-5.7-3.20090208.el6.x86_64.rpm

Rpm-ivh ncurses-devel-5.7-3.20090208.el6.x86_64.rpm

Warning: ncurses-devel-5.7-3.20090208.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing... # [100%]

1:ncurses-devel # # [100%]

At the same time, rm-rf CMakeCache.txt and then re-cmake

After completion, use make & & make install to install mysql

-Installing: / mysql/man/man1/msql2mysql.1

-- Installing: / mysql/man/man8/mysqld.8

-- Installing: / mysql/support-files/solaris/postinstall-solaris

After the installation is complete, you need to configure it.

This is the step of 5.7.17.

4: enter the installation directory of mysql and / mysql: initialize the mysql database

Scripts/mysql_install_db-- basedir=mysql-- datadir=/mysql/data-- user=mysql / / initialize mysql database

But report the error.

[root@db_test scripts] # / mysql_install_db-- basedir=mysql-- datadir=/mysql/data-- user=mysql

FATAL ERROR: Could not find. / bin/my_print_defaults

Cd / u01/soft/mysql-5.6.17/support-files

Cp my-default.cnf / usr/local/mysql/my.cnf / / copy configuration file

[root@db_test support-files] # chown-R mysql:mysql / mysql

Vi / my.cnf adds the following

[mysqld]

Basedir = / mysql

Datadir = / mysql/data

Log-error = / mysql/mysql_error.log

Pid-file = / mysql/mysql.pid

User = mysql

Tmpdir = / tmp

Initialize the mysql database

[root@db_test scripts] # / mysql_install_db-- basedir=/mysql-- datadir=/mysql/data-- user=mysql

Installing MySQL system tables...2017-05-11 15:01:56 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

2017-05-11 15:01:56 8161 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-05-11 15:01:56 8161 [Note] InnoDB: The InnoDB memory heap is disabled

2017-05-11 15:01:56 8161 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-05-11 15:01:56 8161 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-05-11 15:01:56 8161 [Note] InnoDB: Using CPU crc32 instructions

2017-05-11 15:01:56 8161 [Note] InnoDB: Initializing buffer pool, size = 128.0m

2017-05-11 15:01:56 8161 [Note] InnoDB: Completed initialization of buffer pool

2017-05-11 15:01:56 8161 [Note] InnoDB: Highest supported file format is Barracuda.

2017-05-11 15:01:56 8161 [Note] InnoDB: Log scan progressed past the checkpoint lsn 1600617

2017-05-11 15:01:56 8161 [Note] InnoDB: Database was not shutdown normally!

2017-05-11 15:01:56 8161 [Note] InnoDB: Starting crash recovery.

2017-05-11 15:01:56 8161 [Note] InnoDB: Reading tablespace information from the .ibd files...

2017-05-11 15:01:56 8161 [Note] InnoDB: Restoring possible half-written data pages

2017-05-11 15:01:56 8161 [Note] InnoDB: from the doublewrite buffer...

Or use the following command to add mysql as a system service

Cd/mysql/support-files/

Cp. / mysql.server / etc/init.d/mysqld

/ etc/init.d/mysqld start

When configuring environment variables

Export PATH=$PATH:/mysql/bin

[mysql@db_test ~] $mysql

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 1

Server version: 5.6.17 Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.

Mysql > show databases

+-+

| | Database |

+-+

| | information_schema |

| | test |

+-+

2 rows in set (0.00 sec)

Installation steps for version 5.7.19 of 5RV

5.7.19 installation is a good time to prompt

CMake Error at cmake/boost.cmake:81 (MESSAGE):

You can download it with-DDOWNLOAD_BOOST=1-DWITH_BOOST=

So download the boost software

[root@localhost ~] # wget http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz

Tar-xf boost_1_59_0.tar.gz

Cp-r boost_1_59_0 / usr/local/boost

Carry out installation

Cmake\

-DCMAKE_INSTALL_PREFIX=/mysql/mysql\

-DMYSQL_DATADIR=/mysql/mysql/data\

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci\

-DMYSQL_TCP_PORT=3306\

-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/boost

When you are done, do make & & make install

It takes a long time to go out for a smoke.

Configure environment variables

Export PATH=/mysql/mysql/bin:/mysql/mysql/lib:$PATH

It takes a long time

Cd mysql/bin

. / mysqld-initialize-insecure-user=mysql-basedir=/mysql/mysql-datadir=/mysql/data

[root@localhost mysql] # cp support-files/mysql.server / etc/init.d/mysqld

[root@localhost mysql] # chmod adepx / etc/init.d/mysqld

Re-edit / etc/my.cnf

[mysqld]

Datadir=/mysql/data

Socket=/mysql/mysql.sock

User=mysql

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

Symbolic-links=0

[mysqld_safe]

Log-error=/mysql/mysql/logs/mysqld.log

Pid-file=/mysql/mysql/logs/mysqld.pid

[client]

Default-character-set=utf8

Socket=/mysql/mysql.sock

[mysql]

Default-character-set=utf8

Socket=/mysql/mysql.sock

Start mysql

[root@localhost mysql] # service mysqld start

Starting MySQL.2018-08-30T01:45:21.383785Z mysqld_safe error: log-error set to'/ mysql/mysql/logs/mysqld.log', however file don't exists. Create writable for user 'mysql'.

The server quit without updating PID file (/ mysql/data/loca [failed] localdomain.pid)

An error is reported and a file needs to be created.

[root@localhost logs] # touch mysqld.log

[root@localhost logs] # touch mysqld.pid

[root@localhost logs] # chown-R mysql:mysql / mysql

[root@localhost mysql] # service mysqld start

Starting MySQL. [OK]

[root@localhost mysql] #

[mysql@localhost ~] $mysql

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 3

Server version: 5.7.19 Source distribution

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.

Mysql > show databases

+-+

| | Database |

+-+

| | information_schema |

| | mysql |

| | performance_schema |

| | sys |

+-+

4 rows in set (0.00 sec)

Mysql >

Then change the password of root

Database changed

Mysql > select host,user,authentication_string from user

+-- +

| | host | user | authentication_string | |

+-- +

| | localhost | root |

| | localhost | mysql.session | * THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |

| | localhost | mysql.sys | * THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |

+-- +

3 rows in set (0.00 sec)

Mysql > UPDATE user SET authentication_string=PASSWORD ('shenzhen#123') WHERE user='root'

Query OK, 1 row affected, 1 warning (0.01 sec)

Rows matched: 1 Changed: 1 Warnings: 1

Mysql > flush privileges

Query OK, 0 rows affected (0.00 sec)

Mysql > select host,user,authentication_string from user

+-- +

| | host | user | authentication_string | |

+-- +

| | localhost | root | * 4E25F9206A350692D2F5AC0512B41C69759FF312 |

| | localhost | mysql.session | * THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |

| | localhost | mysql.sys | * THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |

+-- +

3 rows in set (0.00 sec)

Mysql >

Mysql >

This is the end of this article on "how to install version 5.7-17-19 of mysql source code". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report