Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql installation rpm mode

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

View the rpm packages installed on the system

Rpm-qa | grep mysql

Uninstall mysql that comes with it

Rpm-e-nodeps *

Decompress mysql

Tar-xvf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar

Installation sequence

Mysql-community-common-5.7.18-1.el7.x86_64.rpm

Mysql-community-libs-5.7.18-1.el7.x86_64.rpm (dependent on common)

Mysql-community-client-5.7.18-1.el7.x86_64.rpm (dependent on libs)

Mysql-community-server-5.7.18-1.el7.x86_64.rpm (dependent on common,client)

Mysql-community-devel-5.7.18-1.el7.x86_64.rpm (MySQL header and library files)

Mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm

Execute the following command:

Rpm-ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm

Rpm-ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm

Rpm-ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm

Rpm-ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm

Rpm-ivh mysql-community-devel-5.7.18-1.el7.x86_64.rpm

Rpm-ivh mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm

If an error is reported, execute yum remove mariadb-libs

Forced unloading

Rpm-e-- nodeps mariadb-libs-5.5.41-2.el7_0.x86_64

Start the mysql command systemctl start mysqld to see if it starts successfully: systemctl status mysqld.service resets the password of mysql vi / etc/my.cnf

Add at the end of the file

Character_set_server=utf8-sets the character set

Init_connect='SET NAMES utf8'

Lower_case_table_names=1-ignore case

Skip-grant-tables=1-enter mysql without password

Restart the mysqld service command systemctl restart mysqld

Then enter mysql-u root

Use mysql

Update user set authentication_string = password ('* *')

Password_expired='N',password_last_changed = now () where user = 'root'; FLUSH PRIVILEGES

Exit the database

Exit

Delete the line of the added configuration file, move the cursor to the bottom, press the "I" key, and delete skip-grant-tables=1

Log in to MYSQL

Mysql-u root-packs *

GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' * * 'WITH GRANT OPTION;-- an absolutely indispensable step

CREATE DATABASE `* *` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

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.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report