In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Install the dependency package first to avoid problems during installation
[root@chufeng yusen] # yum-y install wget vim bash-completion [root@chufeng yusen] # yum-y install gcc gcc-c++ cmake ncurses-devel autoconf perl perl-devel
two。 Download mysql-5.6.40.tar.gz
MySQLxxx download address: https://dev.mysql.com/downloads/mysql/5.6.html#downloads
Source code packet address: https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.40.tar.gz
[root@chufeng yusen] # wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.40.tar.gz[root@chufeng yusen] # ls mysql-5.6.40.tar.gz
3. Create a mysql installation directory and a data storage directory
[root@chufeng yusen] # mkdir-p / usr/local/mysql/data
4. Create users, user groups
[root@chufeng yusen] # groupadd mysql [root@chufeng yusen] # useradd-r-g mysql mysql
5. Extract the files to the current folder and install
[root@chufeng yusen] # tar-zxvf mysql-5.6.40.tar.gz [root@chufeng yusen] # cd mysql-5.6.40 [root@chufeng mysql-5.6.40] # cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql\-DINSTALL_DATADIR=/usr/local/mysql/data\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DEXTRA_CHARSETS=all\-DENABLED_LOCAL_INFILE= 1 [root @ chufeng mysql-5.6.40] # make & & make install
CMAKE parameter description:
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql / / default installation directory
-DINSTALL_DATADIR=/usr/local/mysql/data / / database storage directory
-DDEFAULT_CHARSET=utf8 / / use utf8 characters
-DDEFAULT_COLLATION=utf8_general_ci / / check character
-DEXTRA_CHARSETS=all / / install all extended character sets
-DENABLED_LOCAL_INFILE=1 / / allow data to be imported locally
-DMYSQL_USER=mysql
-DMYSQL_TCP_PORT=3306
For detailed configuration of CMAKE, please refer to the official website of mysql
Note:
If the installation fails to recompile, you need to clear the old object files and cache information.
[root@chufeng mysql-5.6.40] # make clean [root@chufeng mysql-5.6.40] # rm-f CMakeCache.txt [root@chufeng mysql-5.6.40] # rm-rf / etc/my.cnf
6. Set directory permissions
[root@chufeng yusen] # cd / usr/local/mysql [root@chufeng mysql] # chown-R mysql:mysql. [root@chufeng mysql] # chown-R mysql:mysql data
7. Add mysql startup service to the system service
[root@chufeng yusen] # cd / usr/local/mysql [root@chufeng mysql] # cp support-files/my-default.cnf / etc/my.cnf
8. Create the underlying table
[root@chufeng yusen] # cd / usr/local/mysql [root@chufeng mysql] #. / scripts/mysql_install_db-- user=mysql
9. Configure environment variables (add the following two)
[root@chufeng yusen] # vim / etc/profileexport MYSQL_HOME= "/ usr/local/mysql" export PATH= "$PATH:$MYSQL_HOME/bin" * * # load environment variable * * [root@chufeng yusen] # source / etc/profile
10. Add the mysql startup file to the system startup file
[root@chufeng yusen] # cd / usr/local/mysql/ [root@chufeng mysql] # cp support-files/mysql.server / etc/init.d/mysql
Start, stop and restart commands for 11.mysql
Start the mysql service
[root@chufeng yusen] # systemctl start mysql
Restart the mysql service
[root@chufeng yusen] # systemctl restart mysql
Stop the mysql service
[root@chufeng yusen] # systemctl stop mysql
Self-booting
[root@chufeng yusen] # systemctl enable mysql
Or:
Start the mysql service
[root@chufeng yusen] # service mysql start
Restart the mysql service
[root@chufeng yusen] # service mysql restart
Stop the mysql service
[root@chufeng yusen] # service mysql stop
Add services to the list of services managed by boot instructions
Chkconfig-add mysql
Self-booting
Chkconfig mysql on
twelve。 Modify mysql password
[root@chufeng yusen] # mysqladmin-u root passwordNew password: Confirm new password: [root@chufeng yusen] #
13. Connect Mysql
[root@chufeng yusen] # mysql-u root-p Enter password: Welcome to the MySQL monitor Commands end with; or\ g.Your MySQL connection id is 2Server version: 5.6.40 Source distributionCopyright (c) 2000, 2016, 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 >
Here, the mysql-5.6.40 source code installation is complete.
Summary
The above is the CentOs7 64-bit mysql 5.6.40 source code installation process introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!
If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!
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.