In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to install cmake on mysql on linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
1. Prepare before installation:
1) essential packages and tools
Gcc/g++: starting with MySQL 5. 6, you need to compile with MySQL +.
Cmake: starting with MySQL 5.5.Using cmake for project management, cmake requires version 2.8or above.
Bison: the MySQL syntax parser needs to be compiled using bison.
Ncurses-devel: a development package for terminal operations.
Zlib: MySQL uses zlib for compression
2) packages required by the function
Libxml: support for XML input and output.
Openssl: communicate using openssl secure sockets.
Dtrace: used to diagnose MySQL problems.
2. Add users and groups
[root@node-1 ~] # groupadd mysql
[root@node-1] # useradd-d / home/mysql-g mysql-m mysql
[root@node-1 ~] # password mysql
3. Configure user environment variables
[root@node-1 ~] # su-mysql
[mysql@node-1 ~] $vim .bash _ profile
PATH=$PATH:$HOME/bin:/u01/my3306/bin
[mysql@node-1 ~] $source .bash _ profile # effective immediately source .bash _ profile
4. Install the libraries required by mysql:
[root@faspdev mnt] # yum-y install gcc gcc-c++
[root@faspdev mnt] # yum-y install ncurses
[root@faspdev mnt] # yum-y install ncurses-devel
[root@faspdev mnt] # yum-y install bison zlib openssl
[root@faspdev usr] # yum-y install libxml2
5. Install cmake
[root@faspdev usr] # tar-zxvf cmake-3.6.0.tar.gz
[root@faspdev usr] # ln-s / usr/cmake-3.6.0-Linux-i386/bin/* / usr/bin/
[root@faspdev usr] # cmake-- version
6. Establish a standard catalogue
[root@node-1 ~] # mkdir-p / u01/my3306/data data
[root@node-1 ~] # mkdir-p / u01/my3306/log/iblog data dictionary log and innoDB log
[root@node-1 ~] # mkdir-p / u01/my3306/log/binlog server layer log
[root@node-1] # mkdir-p / u01/my3306/run
[root@node-1] # mkdir-p / u01/my3306/tmp temporarily
7. Authorization
[root@node-1] # chown-R mysql:mysql / u01/my3306
Authorize the / u01/my3306 folder to the mysql and mysql group-R folders and subdirectories
[root@node-1] # chmod-R 755 / u01/my3306
8. Install the upload tool lrzsz
Upload mysql package / U01 directory when yum install-y lrzsz is used by rz
9. Decompress mysql
[root@node-1 ~] # tar-xzvf mysql-boost-8.0.11.tar.gz [x (decompress) z (gz properties file) v (show details) f (specified file)]
10. Uninstall the system automatic mysql
Check whether the system has its own mysql rpm-qa | grep mysql
Delete the rpm that needs to be deleted from the mysql rpm-e that comes with the system.
Uninstall mysql yum remove mysql [only individual files can be deleted]
11. Enter cd / u01/mysql-boost-8.0.11 [musql decompression directory]
[root@node-1 mysql-5.6.40] #
1) cmake install mysql database:
Cmake\
-DCMAKE_INSTALL_PREFIX=/u01/my3306\
-DMYSQL_UNIX_ADDR=/u01/my3306/run/mysql.sock\
-DDEFAULT_CHARSET=utf8\
-DDEFAULT_COLLATION=utf8_general_ci\
-DWITH_EXTRA_CHARSETS=utf8,gbk\
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1\
-DWITH_FEDERATED_STORAGE_ENGINE=1\
-DWITH_PARTITION_STORAGE_ENGINE=1\
-DWITH_ARCHIVE_STORAGE_ENGINE=1\
-DMYSQL_DATADIR=/u01/my3306/data\
-DSYSCONFDIR=/u01/my3306\
-DWITH_SSL=bundled\
-DENABLED_LOCAL_INFILE=1\
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DWITH_BLACKHOLE_STORAGE_ENGINE=1\
-DENABLE_DOWNLOADS=1
2) make compilation [the above execution is successful before you can run down]
[root@node-1 mysql-5.6.40] # make
3) make installs mysql to the specified path
[root@node-1 mysql-5.6.40] # make install
12. Configure MYSQL parameter configuration
1. Upload the configuration file [my.cnf] to / u01/mysql3306/
Check the permissions of the my3306 folder. [generally speaking, root users need to change the permissions of my3306.
Chown-R mysql:mysql / u01/my3306]
13. Initialize the database
Switch user mysql su-mysql
[mysql@node-1 my3306] $. / scripts/mysql_install_db-- defaults-file=/u01/my3306/my.cnf\
-datadir=/u01/my3306/data-user=mysql
If there is an error, please check / u01/my3306/log/error.log
Start the mysql server
1) [mysql@node-1 bin] $pwd
/ u01/my3306/bin
2) start the mysql server at the backend. If an exception occurs, the service will restart automatically.
[mysql@node-1 bin] $. / mysqld_safe-- defaults-file=/u01/my3306/my.cnf-- user=mysql &
3) View the mysql process
[mysql@node-1 bin] $ps-ef | grep mysql
4) Log in to the database
[mysql@node-1 my3306] $mysql
[mysql@node-1 my3306] $mysql-h227.0.0.1-uroot
You can log in in both of the above ways
This is the end of the article on "how to install cmake on mysql on linux". 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.
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.