In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the installation method of mysql source code package, which has a certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
Mysql source package installation method: first upload or download the source package, and install dependencies; then extract the installation package and generate; then compile and install, do soft connections, create users, copy configuration files and startup scripts, initialize the database, etc.; finally, start the database and configuration environment variables, and confirm startup.
How to install the mysql source package:
Source package installation
1) upload or download source package
[root@db02 ~] # rz mysql-5.6.46.tar.gz
2) installation dependency
Due to the different installation environment, other errors may also be reported during the generation process, so follow the error prompt to install the corresponding dependency package.
[root@db02 ~] # yum install-y ncurses-devel libaio-devel gcc gcc-c++ glibc cmake autoconf openssl openssl-devel
3) extract the installation package
[root@db02 ~] # tar xf mysql-5.6.46.tar.gz
4) Generation
[root@db02 ~] # cd mysql-5.6.46/ [root@db02 mysql-5.6.46] # cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.6.46\-DMYSQL_DATADIR=/usr/local/mysql-5.6.46/data\-DMYSQL_UNIX_ADDR=/usr/local/mysql-5.6.46/tmp/mysql.sock\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DWITH_EXTRA_CHARSETS=all\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_FEDERATED_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\ -DWITH_ZLIB=bundled\-DWITH_SSL=system\-DENABLED_LOCAL_INFILE=1\-DWITH_EMBEDDED_SERVER=1\-DENABLE_DOWNLOADS=1\-DWITH_DEBUG=0
5) compile and install
[root@db02 mysql-5.6.46] # make & & make install
6) make a soft connection
[root@db02] # ln-s / usr/local/mysql-5.6.46 / usr/local/mysql
7) create a user
[root@db02] # useradd mysql-s / sbin/nologin-M
8) copy configuration files and startup scripts
[root@db02 ~] # cd / usr/local/mysql/support-files/ [root@db02 support-files] # cp my-default.cnf / etc/my.cnfcp: overwrite'/ etc/my.cnf'? Y [root@db02 support-files] # cp mysql.server / etc/init.d/mysqld
9) initialize the database
[root@db02 support-files] # cd / usr/local/mysql/scripts/ [root@db02 scripts] #. / mysql_install_db-user=mysql-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data
8) configure system management mysql
[root@db02 scripts] # vim / usr/lib/systemd/system/ mysqld.service [Unit] Description=MySQL ServerDocumentation=man:mysqld (8) Documentation= https://dev.mysql.com/doc/refman/en/using-systemd.htmlAfter=network.targetAfter=syslog.target[Install]WantedBy=multi-user.target[Service]User=mysqlGroup=mysqlExecStart=/usr/local/bin/mysqld-- defaults-file=/etc/my.cnfLimitNOFILE = 5000 [root@db02 scripts] # systemctl daemon-reload [root@db02 scripts] # systemctl start mysqld
9) Startup failure reports an error
[root@db02 scripts] # / etc/init.d/mysqld startStarting MySQL.Logging to'/ usr/local/mysql-5.6.46/data/db02.err'.200709 15:42:14 mysqld_safe Directory'/ usr/local/mysql-5.6.46/tmp' for UNIX socket file don't exists. ERROR! The server quit without updating PID file (/ usr/local/mysql-5.6.46/data/db02.pid). # reason: the 1.cmake process specifies the location of the socket file, and the actual location does not exist. Insufficient directory permissions # solution: [root@db02 scripts] # mkdir / usr/local/mysql-5.6.46/tmp/ [root@db02 scripts] # chown-R mysql.mysql / usr/local/mysql [root@db02 scripts] # chown-R mysql.mysql / usr/local/mysql-5.6.46/
10) start the database
[root@db02 scripts] # systemctl start mysqld
11) configure environment variables
[root@db03 scripts] # vim / etc/profile.d/mysql.shexport PATH=/usr/local/mysql/bin:$PATH [root@db03 mysql] # source / etc/profile
12) confirm startup
[root@m01 scripts] # ps-ef | grep mysqlmysql 12886 12 03:10? 00:00:00 / usr/local/mysql/bin/mysqld-- defaults-file=/etc/my.cnfroot 12921 10636 0 03:11 pts/1 00:00:00 grep-- color=auto mysql [root@m01 scripts] # netstat-lntp tcp6 00: 3306: * LISTEN 12886/mysqld, thank you for reading this article carefully. I hope the editor will share the contents of the installation method of the mysql source package to help you. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!
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.