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)05/31 Report--
Today, I will talk to you about how to deploy mysql5.7.x binary package on Linux server. Many people may not know much about it. In order to let everyone know more, Xiaobian summarized the following contents for everyone. I hope everyone can gain something according to this article.
mysql 5.7 installation is still a bit different from 5.6, Xiaobian mainly introduces the binary installation method.
mysql 5.7 download address: https://dev.mysql.com/downloads/mysql/5.7.html#downloads
installation
The version I downloaded is mysql 5.7.22 Community Edition
Decompress copy
mv mysql-5.7.22-linux-glibc2.12-x86_64 /usr/local/mysql
Create MySQL users first
groupadd mysqluseradd mysql -s /sbin/nolongin
Create a mysql data directory that will be used when initializing the database
mkdir /mysql /mysql/data /mysql/log
Modify directory permissions
chown -R mysql:mysql /usr/local/mysql /mysql
Create my.cnf file
vim /etc/my.cnf
omitted
Note: Here are some simple configurations
initialize the database
The initialization method prior to 5.7.6 was: bin/mysql_install_db --user=mysql
I downloaded the latest version 5.7.12, which is also the newly released version 4.12. After 5.7.6, mysql_install_db is no longer used to initialize the database.
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/application/data --explicit_defaults_for_timestamp
If log_error of my.cnf is configured, the initial password is in log_error file, otherwise it will be printed.
bin/mysql_ssl_rsa_setup --datadir=/mysql/data
Errors encountered during initialization
[ERROR] Can't find error-message file '/usr/local/mysql/--datadir=/usr/local/mysql/data/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' con
error-message file path should be consistent with the basedir address to resolve the above error
[root@localhost mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/application/data --explicit_defaults_for_timestamp
bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
Solution:
[root@localhost mysql]# yum install numactl -y
[root@localhost mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/application/data --explicit_defaults_for_timestamp
bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Solution:
[root@localhost mysql]# yum install -y libaio
Modify directory permissions
chown -R mysql:mysql /usr/local/mysql /mysql
Configure startup files
cp support-files/mysql.server /etc/init.d/mysqlchkconfig --add mysqlchkconfig mysql onservice mysql start
Configure environment variables
mysql_home=/usr/local/mysqlPATH=$PATH:$mysql_home/binsource /etc/profile
change the password
mysqladmin -uroot -p oldpassword newpassword-S /usr/local/mysql/mysql.sock update mysql.user set authentication_string=password('yourpassword') where user='root' and Host ='localhost ';
After reading the above, do you know more about how to deploy mysql 5.7.x binary packages on Linux servers? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.
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.