Installing MySQL under Linux

Miss Zhu 2022-02-13 08:39:04 阅读数:196

installing mysql linux

stay CentOS7 Lower installation MySQL:

1. Download and install mysql
Sure Windows download rpm Upload the installation package to Linux Or use it directly yum Download and install , The latter method is used in this paper
add to mysql rpm Warehouse

rpm -ivh

Download and install

yum -y install mysql-community-server

The process is slow , Appear below , It means success :
 Insert picture description here

2. start-up mysql

systemctl start mysqld

Check the status

systemctl status mysqld

 Insert picture description here

View version number

mysqladmin --version

 Insert picture description here

3. Sign in Mysql
Check the original password :

cat /var/log/mysqld.log | grep -i 'temporary password'

 Insert picture description here

Sign in mysql

 mysql -uroot -p

As shown in the figure below , Enter the password you just viewed , Note that the screen will not display characters , Press enter after normal input .
 Insert picture description here

 Insert picture description here

Here you can use SQL, Conduct MYSQL operation .

4. Change Password
The password is complex , You can change the password , Pay attention to the rules : Alphanumeric special characters case , This article USES the Hive123+

 ALTER USER 'root'@'localhost' IDENTIFIED BY '********';

***** The password set for , Note that you need to include upper and lower case alphanumeric characters and special symbols

5. Set up remote access
Use mysql library 、 Modify the accessible domain 、 Refresh the permissions

use mysql;
update user set host='%' where user='root';
flush privileges;

The above commands are shown in the figure below :
 Insert picture description here

Use Navicat visit

 Insert picture description here

copyright:author[Miss Zhu],Please bring the original link to reprint, thank you.