In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly gives you a brief description of the specific process of MySQL5.1.72 compilation and installation. You can check the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here, so let's go straight to the topic. I hope this article on the specific process of MySQL5.1.72 compilation and installation can bring you some practical help.
Version number: 5.1.72
OS:RHEL6.5
Installation method: source code compilation and installation
Process:
1. Visit http://www.mysql.com/downloads/, select source code in MySQL Community Server,Select Platform, and download the mysql-5.1.72.tar.gz file under Generic Linux.
two。 Upload mysql-5.1.72.tar.gz to the CVM and decompress it.
3. Go to the directory you unzipped and run the following command in that path:
. / configure-- prefix=/usr/local/mysql\-- with-charset=utf8\ default character set-with-extra-charsets=all\ install additional character set-with-unix-socket-path=/share/data/mysql.sock\ use socket-with-named-curses-libs=/lib64/libncursesw.so.5
Note:
1) you need to install some software needed for compilation in advance:
Yum install gcc gcc-c++ perlyum install cmake
(since 5.6.10, MySQL has used CMAKE instead of configure installation, so this package may not be required for 5.1.72, to be verified)
Yum install ncurses-devel
(--with-named-curses-libs=/lib64/libncursesw.so.5 is said to not specify this parameter, the compilation and installation will fail, and the library file is provided by the ncurses-devel package)
2) / share/data is the directory where I plan to place the database, and the socket directory for communication is also specified here to make it easier to find and enable.
3) (crucially) after the previous compilation and installation, I had a problem logging in to MySQL and prompted a segment error (Segmentation fault). Later, I found a method on the Internet that needed to modify a file in the source package and recompile and install it. After logging in again, I did not encounter this error:
1. In the source package, edit the file cmd-line-utils/libedit/terminal.c2. Find the code snippet similar to char buf [TC _ BUFSIZE];, comment it, and find the following variable area = buf; to change it to area = NULL;. The corrected code is similar: 865 protected int866 terminal_set (EditLine * el, const char * term) 867 {868 int ibot 869 / * char buf [TC _ BUFSIZE]; * / 870 char * area;871 const struct termcapstr * tscape 872 sigset_t oset, nset;873 int lins, cols;874875 (void) sigemptyset (& nset) 876 (void) sigaddset (& nset, SIGWINCH); 877 (void) sigprocmask (SIG_BLOCK, & nset, & oset); 878879 area = NULL; this method comes from http://www.111cn.net/database/mysql/79897.htm
4. Make & & make install
5. After the compilation and installation of MySQL 5.1.72 is complete, start the MySQL service and initialize the database:
It is recommended to use the system user mysql to start and stop the mysql service, so you need to add the mysql user and mysql group to the operating system, and change the directory belonging to the master group of the mysql installation location and database storage location to mysql:
Chown-R mysql:mysql / usr/loca/mysqlchown-R mysql:mysql / share/data/
6. Enter / usr/local/mysql/, to initialize the database:
/ usr/local/mysql/bin/mysql_install_db\-- basedir=/usr/local/mysql/\ prefix-- datadir=/share/data/\ database location-- user=mysql\ use mysql users to start and stop the mysql service
7. Start the mysql service
/ usr/local/mysql/bin/mysqld_safe-- basedir=/usr/local/mysql\-- datadir=/share/data\-- user=mysql &
8. Check the process and port to verify that the installation was successful:
# / usr/local/mysql/bin/mysql-uroot-pEnter password:\ there is no need to enter the password Welcome to the MySQL monitor at this time. Commands end with; or\ g.Your MySQL connection id is 2Server version: 5.1.72 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql >
The prompt appears and the installation is successful.
Note:
1) enter the support-files directory under the directory where the source code is located, and look for the file with the name of * .cnf, which is the configuration file for different running environments provided by mysql. Copy an appropriate one to / etc/, and name it the default configuration file my.cnf:
Cp ~ / mysql-5.1.72/support-files/my-small.cnf / etc/my.cnf
It is necessary to modify or specify the relevant variable values in / etc/init.d/mysqld, such as the following:
[client] socket = / share/data/ mysql.sock [mysqld] socket = / share/data/mysql.sock
2) there is also a mysql.server file in this directory, which is a LSB script provided by mysql. You can copy it to / etc/init.d/ and rename it to mysqld:
Cp ~ / mysql-5.1.72/support-files/mysql.server / etc/init.d/mysqld
It is necessary to modify or specify the relevant variable values in / etc/init.d/mysqld, such as the following:
Basedir=/usr/local/mysql/datadir=/share/data/
Postscript:
1. You can specify datadir as a shared directory for multiple mysql CVMs to use. In this case, you only need to run the mysql_install_db operation on one machine, and other CVM can be accessed through the mysql service.
two。 It is normal to compile and install unsuccessfully once, but you will succeed after many attempts.
MySQL5.1.72 compilation and installation of the specific process to tell you here, for other related issues you want to know can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.
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.