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

Centos7 mysql installation

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

-- force-- nodeps forcibly ignore dependencies

Query whether there is a mysql:

Rpm-qa | grep-I mysql

If you show that it is installed, delete it:

Sudo yum-y remove mysql-libs*

Deleted:

Upload the mysql tar package to the server:

Create a folder:

Mkdir mysql

Decompress:

Tar-xvf mysql-5.7.22-1.el6.x86_64.rpm-bundle.tar

Start the installation:

Sudo rpm-ivh mysql-community-devel-5.7.22-1.el6.x86_64.rpm-force-nodeps

Sudo rpm-ivh mysql-community-client-5.7.22-1.el6.x86_64.rpm-force-nodeps

Sudo rpm-ivh mysql-community-common-5.7.22-1.el6.x86_64.rpm-force-nodeps

Sudo rpm-ivh mysql-community-embedded-5.7.22-1.el6.x86_64.rpm-force-nodeps

Sudo rpm-ivh mysql-community-server-5.7.22-1.el6.x86_64.rpm-force-nodeps

Sudo rpm-ivh mysql-community-embedded-devel-5.7.22-1.el6.x86_64.rpm-force-nodeps

Sudo rpm-ivh mysql-community-libs-5.7.22-1.el6.x86_64.rpm-force-nodeps

Sudo rpm-ivh mysql-community-libs-compat-5.7.22-1.el6.x86_64.rpm-force-nodeps

Startup: sudo / etc/init.d/mysqld start error report

Add package: (useless)

Numactl-2.0.11-8.fc28.x86_64

Numactl-devel-2.0.11-9.fc29.x86_64

Numactl-libs-2.0.11-9.fc29.x86_64

Installation: (useless)

Sudo rpm-ivh numactl-2.0.11-8.fc28.x86_64.rpm-force-nodeps

Sudo rpm-ivh numactl-devel-2.0.11-9.fc29.x86_64.rpm-force-nodeps

Sudo rpm-ivh numactl-libs-2.0.11-9.fc29.x86_64.rpm-force-nodeps

Start again: sudo / etc/init.d/mysqld start error

Add package: (useful for problem solving)

Libaio-0.3.107-10.el6.x86_64

Installation:

Sudo rpm-ivh libaio-0.3.107-10.el6.x86_64.rpm-force-nodeps

Third boot: sudo / etc/init.d/mysqld start error report

View the versions supported by the system glibc:

Strings / lib64/libc.so.6 | grep GLIBC_

Install gcc:

Create a new folder gcc

Mkdir gcc

Import package:

Installation:

Sudo rpm-ivh mpfr-3.1.1-4.el7.x86_64.rpm-force-nodeps

Sudo rpm-ivh libmpc-1.0.1-3.el7.x86_64.rpm-force-nodeps

Sudo rpm-ivh kernel-headers-3.10.0-862.el7.x86_64.rpm-force-nodeps

Sudo rpm-ivh glibc-headers-2.17-222.el7.x86_64.rpm-force-nodeps

Sudo rpm-ivh glibc-devel-2.17-222.el7.x86_64.rpm-force-nodeps

Sudo rpm-ivh cpp-4.8.5-28.el7.x86_64.rpm-force-nodeps

Sudo rpm-ivh gcc-4.8.5-28.el7.x86_64.rpm-force-nodeps

Install the remaining packages of glibc:

Import package:

Install the package:

Sudo rpm-ivh glibc-common-2.17-222.el7.x86_64.rpm-force-nodeps

Sudo rpm-ivh glibc-2.17-222.el7.x8664.rpm-force-nodeps

View the versions supported by the system glibc:

Strings / lib64/libc.so.6 | grep GLIBC

Fourth startup: sudo / etc/init.d/mysqld start successful

Change the mysql root password:

Stop the service:

Sudo / etc/init.d/mysqld stop

Password-free startup:

Sudo mysqld_safe-- skip-grant-tables &

Login:

Mysql-u root-p

If the password is empty, enter directly:

Use the database:

Use mysql

Change the password:

UPDATE user SET authentication_string=PASSWORD ('root') where USER='root'

UPDATE user SET password=PASSWORD ('root') where USER='root'

Flush privileges

Exit

Restart the mysql service:

Sudo / etc/init.d/mysqld restart

Login with account password:

Mysql-u root-p

Root

Change the password:

Alter user user () identified by "! QAZ2wsx"

View the connection port:

Show global variables like 'port'

If it is 3306, no modification is required.

Second, the modification of MySQL port number

1. Edit / etc/my.cnf file [root@localhost ~] # vi / etc/my.cnf

2. Add port=2032

3. Restart mysql [root@localhost ~] # / etc/init.d/mysqld restart

Create a remote connection user and authorize:

View the current user:

Select Host,User,Password from mysql.user

Version 5.7 and above password=authentication_string

Select Host,User,authentication_string from mysql.user

Query results show that there are no remotely accessible users

Add a user:

Create user changan_test identified by 'Passw0rd'

User authorization

Grant all privileges on. To 'changan_test'@'%'identified by' Passw0rd' with grant option

Flush privileges

Grant all privileges on. To 'jira'@'%'identified by' Passw0rd*' with grant option

Flush privileges

View users:

Changantest can be accessed at any address (host)

Access attempt:

View firewall: firewall on

Turn off the firewall:

Try to connect remotely again: (connect successfully)

Create the database and execute the sql file

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

Database

Wechat

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

12
Report