In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Here are a few steps to install mysql with centso7.2 source code. The secret of the text lies in being close to the topic. So, no gossip, let's go straight to the following, I believe you will benefit from reading this article on how to install mysql in centso7.2 source mode.
Install mysql-boost-5.7.17.tar.gz in source mode
1. Preparatory work
Close SELinux and download the package from the firewall-> https://www.mysql.com/
Uninstall mariadb that comes with it
2. Uninstall the mariadb software that comes with the system
[root@mysqltest ~] # rpm-qa | grep mariadb
Mariadb-libs-5.5.44-2.el7.centos.x86_64
[root@mysqltest] # rpm-e-nodeps mariadb-libs
3. Create a data directory / mydata/data
[root@mysqltest] # mkdir-p / mydata/data
Modify the ownership of the data directory
[root@node02] # useradd-s / sbin/nologin-M mysql
[root@node02] # chown-R mysql.mysql / mydata/data/
4. Install the cmake compiler
[root@node02 ~] # yum install-y cmake
[root@node02 ~] # tar zxf mysql-boost-5.7.17.tar.gz
Cmake. -L View compilation options supported by cmake
[root@node02 ~] # cd mysql-5.7.17/
[root@mysql57 mysql-5.7.17] # cmake. \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock\
-DDEFAULT_CHARSET=utf8\
-DDEFAULT_COLLATION=utf8_general_ci\
-DMYSQL_DATADIR=/mydata/data\
-DMYSQL_TCP_PORT=3306\
-DWITH_BOOST=boost/boost_1_59_0/\
-DWITH_MYISAM_STORAGE_ENGINE=1\
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DWITH_ARCHIVE_STORAGE_ENGINE=1\
-DWITH_BLACKHOLE_STORAGE_ENGINE=1\
Error 1:
CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error at cmake/os/Linux.cmake:41 (MESSAGE):
Unsupported compiler!
Call Stack (most recent call first):
CMakeLists.txt:162 (INCLUDE)
Solution:
# yum groupinstall-y "Development Tools"Server Platform Development"Desktop Platform Development"
Error 2:
CMake Error at cmake/readline.cmake:64 (MESSAGE):
Curses library not found. Please install appropriate package
Solution:
[root@node02 ~] # yum install-y ncurses-devel.x86_64
[root@mysqltest mysql-5.7.17] # make
[root@mysqltest mysql-5.7.17] # make install
[root@mysqltest] # chown-R root.mysql / usr/local/mysql/
5. Initialize the database
[root@mysql57] # / usr/local/mysql/bin/mysqld-initialize-user=mysql-basedir=/usr/local/mysql-datadir=/mydata/data
6. Copy the MySQL configuration file
[root@node02 ~] # cd / usr/local/mysql/support-files/
[root@node02 support-files] # cp my-default.cnf / etc/my.cnf
[root@node02 support-files] # vim / etc/my.cnf
[mysqld]
...
Basedir=/usr/local/mysql
Datadir=/mydata/data
Port=3306
Server_id=121
Socket=/tmp/mysql.sock
7. Start the mysql service
[root@mysqltest data] # / usr/local/mysql/bin/mysqld_safe-- user=mysql &
[root@mysqltest data] # ss-antp | grep mysqld
LISTEN 0 80: 3306: * users: ("mysqld", pid=63756,fd=20)
[root@mysqltest data] #
8. Modify the environment variable PATH
[root@mysqltest] export PATH=$PATH:/usr/local/mysql/bin temporary
[root@mysqltest] echo $PATH
[root@mysqltest data] # cat / etc/profile.d/mysql.sh
Export PATH=$PATH:/usr/local/mysql/bin
[root@mysqltest data] # source / etc/profile.d/mysql.sh
[root@mysqltest data] # mysql-u root-p
Mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY' Www.1.com'
Mysql > FLUSH PRIVILEGES
Query OK, 0 rows affected (0.00 sec)
9. Set the source code mysql service to boot automatically
# vim / etc/rc.d/rc.local
/ usr/local/mysql/bin/mysqld_safe-user=mysql &
For the above centso7.2 source code installation of mysql several steps related to the content, is there anything you do not understand? Or if you want to know more about it, you can continue to follow our industry information section.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.