In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
What the editor wants to share with you this time is how to install and configure MySQL5.7.20 under Centos7. The article is rich in content. Interested friends can learn about it. I hope you can get something after reading this article.
1. Download the MySQL5.7 installation package: mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz on the official website.
two。 Remote access to CentOS7 through SSH Secure Shell Client
3. Uninstall the Mariadb database that comes with the system
4. Create mysql user groups and mysql users
5. Upload the MySQL installation package to the CentOS7 server / root directory and extract it (here I use filezilla to log in to the remote service and then upload the installation package to the root directory. The decompression is first cd to the current file directory, and execute the following directory)
# tar xzvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
6. Move the unzipped installation package to the / data directory and rename it to mysql
# mv / root/mysql-5.7.20-linux-glibc2.12-x86_64 / data/mysq
Here, log in to the service directly with filezilla, create a new data folder, and then move the extracted files to the data directory and name them mysql.
The result is as follows
7. Modify permissions
8. Create a data directory under the mysql directory as the database storage location
# mkdir / data/mysql/data (here you create a data directory under the mysql directory)
9. Initialize mysql
10. Start MySQL and check to see if it has started successfully
11. Log in to MySQL with the initial password and change the password
twelve。 Shut down the MySQL service and see if the shutdown was successful
13. Set boot self-boot
In the future, you can use the service command to control the start and stop of mysql. The commands are: service mysqld start and service mysqld stop, and may report an error when executing, as shown in the following figure.
This is because mysql is installed in the / usr/local directory by default, and if installed in the / usr/local directory, it will start and shut down normally without error. But this time, the installation is in the custom / data directory. You need to modify the vi / etc/init.d/mysqld file at this time, save it and exit.
Then execute the service mysqld start startup command, OK
Then execute the service mysqld stop close command, OK
14. Configure global environment variables
Edit / etc/profile file
# vi / etc/profile
Add the following two lines of configuration at the bottom of the profile file, save and exit
PATH=/data/mysql/bin:/data/mysql/lib:$PATHexport PATH
Setting the environment variable takes effect immediately
# source / etc/profile
15. Set up remote host login
First, service mysqld start starts the service.
Then log in to mysql:# mysql-uroot-p and execute the following command
Remote login failed
Check whether port 3306 is open
# netstat-nupl | grep 3306
Open port 3306 and restart the firewall
Log in remotely again, successfully
16. End!
After mysql is installed, try to link mysql in the program and find that the connection is not working. The error is as follows
WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45mm, 5.6.26 + and 5.7.6 + requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
It is a problem with the SSL connection to the Mysql database, which prompts you to warn that it is not recommended to use a SSL connection without server authentication, which occurs only in MYSQL5.5.45+, version 5.6.26 + and 5.7.6 +. The solution has been stated in the warning.
Add useSSL=false to the url of the database connection
Vi command
Ctrl+u: turn half the screen to the first part of the file
Ctrl+d: flip half the screen to the end of the file
Ctrl+f: flip a screen to the end of the file
Ctrl+b: flip through the first screen of the file
Esc: switch from edit mode to command mode
ZZ: exit vi after saving changes to the current file in command mode
Line number: cursor jumps to the beginning of the specified line
:: the cursor jumps to the beginning of the last line
X or X: delete a character, x after the cursor, and X before the cursor
D: delete all characters from the current cursor to the end of the line where the cursor is located
Dd: delete the forward line content of the cursor line
Ndd: delete the current line and the subsequent nmur1 line
Nyy: save the contents of the current line and its next n lines to a register? In, among them? For a letter, n for a number
P: paste text operation, used to paste the contents of the cache area below the current cursor location
P: paste text operation, used to paste the contents of the cache area above the current cursor location
/ string: text lookup operation, which is used to find the contents of the specified string at the end of the file starting from the current cursor position. The searched string will be highlighted.
? Name: text lookup operation, which is used to find the contents of the specified string in the file header starting from the current cursor position. The searched string will be highlighted.
Replacements text operation that converts F strings into T strings between lines an and b. Where "s /" indicates a replacement operation
A: add text after the current character
A: add text at the end of the line
I: insert text before the current character
I: insert text at the beginning of the line
O: insert a blank line after the current line
O: insert a blank line before the current line
: wq: execute the save exit operation in command mode
W: perform the save operation in command mode
: w! : in command mode, perform a forced save operation
: Q: in command mode, execute the exit vi operation
: q! In command mode, perform a forced exit vi operation
: e file name: in command mode, open and edit a file with the specified name
: n: in command mode, if you open multiple files at the same time, continue to edit the next file
: F: in command mode, it is used to display the current file name, the line number of the line where the cursor is located, and the display scale
: set number: in command mode, it is used to display the line number at the leftmost end
: set nonumber: in command mode, the line number is not displayed at the leftmost end
After reading this article on how to install and configure MySQL5.7.20 under Centos7, if you think the article is well written, you can share it with more people.
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.