In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Environment introduction >
Operating system: Centos 7.1
Mysql database version: mysql5.7.9
Mysql official website: http://www.mysql.com
-
1. Before installing the new version of mysql, we need to uninstall the mariadb-lib that comes with the system.
[root@5201351 ~] # rpm-qa | grep mariadbmariadb-libs-5.5.41-2.el7_0.x86_64 [root@5201351 ~] # rpm-e mariadb-libs-5.5.41-2.el7_0.x86_64-- nodeps
2. Go to mysql's website to download the latest version of mysql's rpm collection package: mysql-5.7.9-1.el7.x86_64.rpm-bundle.tar
3. Upload mysql-5.7.9-1.el7.x86_64.rpm-bundle.tar to the linux server and extract the tar package
4. For the simplest way to install the mysql-server service, you only need to install the following four software packages. We can use the rpm-ivh command to install it.
Mysql-community-common-5.7.9-1.el7.x86_64.rpm
Mysql-community-libs-5.7.9-1.el7.x86_64.rpm-(dependent on common)
Mysql-community-client-5.7.9-1.el7.x86_64.rpm-(dependent on libs)
Mysql-community-server-5.7.9-1.el7.x86_64.rpm-(dependent on client, common)
5. The next step is to initialize the database. We can use the following commands, and the effect is the same.
[root@5201351 ~] # mysql_install_db-- datadir=/var/lib/mysql / / must specify datadir. After execution, it will generate ~ / .mysql_secret password file [root@5201351 ~] # mysqld-- initialize / / this method is recommended. The executor will generate a random password in / var/log/mysqld.log.
6. Change the users and groups of the mysql database directory, and then start the mysql database
[root@5201351 ~] # chown mysql:mysql / var/lib/mysql-R [root@5201351 ~] # systemctl start mysqld.service / / start the mysql database service
7. Log in to mysql according to the password in step 5 and change the password of the root user. The new version of mysql cannot execute any commands before changing the password after the first login.
[root@5201351 ~] # mysql-uroot-p') j#) = uRig4yJ'mysql > set password=password ('www.cnblogs.com/5201351')
Finally, we can also create users and assign permissions according to the actual situation.
Mysql > create user 'root'@'192.168.100.2' identified by' QQ5201351'; mysql > GRANT ALL PRIVILEGES ON dbname.* to 'root'@'192.168.100.2';mysql > flush privileges
=
Last but not least, there is no Password field in the user table under the new version of mysql database.
Instead, the encrypted user password is stored in the authentication_string field
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.