In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Mysql binary installation method
Download mysql
Https://dev.mysql.com/downloads/mysql/
1. Decompression package
Tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz
two。 Actual production environment
Mv mysql-5.7.24-linux-glibc2.12-x86_64 / usr/local/mysql5.7
a. New Mysql user group
Groupadd mysql
b. New users
Opt] # useradd-r-g mysql mysql
c. Give mysql directory permissions
Chown-R mysql:mysql mysql5.7
3. To the directory where the environment is initialized
Cd / home/usr/local/mysql5.6/mkdir datamkdir logchown-R mysql:mysql mysql5.7
4. Initialize data and specify installation directory and data directory
. / bin/mysqld-initialize-user=mysql-basedir=/usr/local/mysql5.7/-datadir=/usr/local/mysql5.7/data/
6 copy startup file
Cp mysql.server / etc/init.d/mysqldchmod + x / etc/init.d/mysqld
7. Modify the startup path
Vi / etc/init.d/mysqldbasedir= / usr/local/mysql5.7datadir= / usr/local/mysql5.7/data
8. Increase the environment variable (add at the bottom) l
Vi / etc/profileexport MYSQL_HOME= "/ usr/local/mysql5.7" export PATH= "$PATH:$MYSQL_HOME/bin"
9. Refresh the configuration file
Source / etc/profile
Modify the configuration file
Vi / etc/ my.cnf[client] port= 3306[mysqld] basedir=/usr/local/mysql5.7datadir=/usr/local/mysql5.7/data#socket=/usr/local/mysql5.7/mysql.socksocket=/tmp/mysql.sockuser=mysql#skip-grant-tables# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0# Settings user and group are ignored when systemd is used.# If you need to run mysqld under a different user or group # customize your systemd unit file for mariadb according to the# instructions in http://fedoraproject.org/wiki/Systemd[mysqld_safe]log-error=/usr/local/mysql5.7/log/mysqld.logpid-file=/usr/local/mysql5.7/data/mysqld.pid## include all files from the config directory#!includedir / etc/my.cnf.d
11. Add enable self-boot
Chkconfig-add mysqld chkconfig mysqld on
twelve。 Start mysqld
Service mysqld start netstat-anpt
13. Change the password (there is a password when the password is initialized)
2018-11-02T02:07:44.574468Z 1 [Note] A temporary password is generated for root@localhost: lXyB0%fi#9-S (this is the password) mysql > help contentsERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql > help contentsERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql > show databases;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
Solution.
1. Modify the user's password
Mysql > alter user 'root'@'localhost' identified by' youpassword'
Or
Mysql > set password=password ("youpassword")
2. Refresh permissions
Mysql > flush privileges;mysql > help contents
Summary
The above is the method of installing MySQL 5.7.24 binary version of Centos 7 introduced 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!
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.