In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to compile and install Mysql manually". In daily operation, I believe many people have doubts about how to compile and install Mysql manually. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to compile and install Mysql manually". Next, please follow the editor to study!
Compile and install Mysql:
one。 Set up a data catalog. (default is under the mysql installation directory)
1. Create a directory / mydata/data
[note: any directory created under the mysql data directory will be recognized as a database]
two。 Establish a separate partition / dev/sdaX (based on the actual situation, it is recommended to use LVM logical volumes)
3. Mount the newly created partition to / mydata
4. Edit boot auto mount
Vim / etc/fstab
Add something like the following line:
Device mount point file system defaults 0 0
two。 Create user: the user used by the Mysql operation
1.groupadd-g 3306 mysql
2.useradd-u 3306-g mysql-M-s / sbin/nologin mysql
three。 Give mysql users all permissions on the data directory
Chown-R mysql:mysql / mydata
four。 Decompress configuration Mysql
1.tar xf mysql-5.5.15-linux2.6-i686.tar.gz-C / usr/local
2.cd / usr/local
3.ln-sv mysql-5.5.15-linux2.6-i686 mysql
4.cd mysql
5.chown-R mysql:mysql.
Initialize Mysql:
6.scripts/mysql_install_db-user=mysql-datadir=/mydata/data
7.chown-R root.
five。 Configuration service startup:
Prepare the startup script:
8.cp support-files/mysql.server / etc/init.d/mysqld
Join the service queue
9.chkconfig-add mysqld
Set the boot to start automatically
10.chkconfig mysqld on
Copy the configuration file:
11.cp support-files/my-large.cnf / etc/my.cnf
12.vim / etc/my.cnf
Add the following under the [mysqld] field
Datadir = / mydata/data
Change thread_concurrency = 8 to thread_concurrency = 2
Start the service:
13.service mysqld start
[note: if startup fails, please check the file ending with ".err" in the "data directory"]
six。 Prepare header files, library files, PATH variables (not required, but files that depend on mysql will go to the default directory to find relevant files)
# Library files:
Vim / etc/ld.so.conf.d/mysql.conf
Add: / usr/local/mysql/lib-- > Save exit
Ldconfig (- v displays the execution result)
# header file:
Ln-sv / usr/local/mysql/include / usr/include/mysql
# PATH
Vim / etc/profile
Add: PATH=$PATH:/usr/local/mysql/bin (it is recommended to add to the "export" line)
Source / etc/profile
# MAN (it doesn't matter if you don't want to configure it)
Vim / etc/man.config
Add: MANPATH / usr/local/mysql/man
At this point, the study on "how to compile and install Mysql manually" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.