Preface: Recently I am going to team up with my partners to work on a .NET Core project. So I rented an Alibaba Cloud server and installed Linux and MySQL. My Linux here is CentOs 7. The first step is to add the Mysql Yum library Here you need to go to the official website to get a specific rpm package. I chose the following package Transfer the RPM package to the Opt directory on the Linux server through Xshell and enter the command: sudo rpm -Uvh mysql80-community-release-fc28-1.noarch.rpm The second step is to select the version you need (default 8.0) Here we manually configure it to version 5.7 and enter the following command: sudo yum-config-manager --disable mysql80-community sudo yum-config-manager --enable mysql57-community Then enter the view command to see the following picture: yum repolist all | grep mysql Here you may be prompted that the yum-config-manager command is not installed. Don’t worry, this command is in the yum-utils package and can be installed using the command yum -y install yum-utils. You can also modify the /etc/yum.repos.d/mysql-community.repo file to achieve the same effect. Step 3 Install Mysql sudo yum install mysql-community-server Step 4: Start the Mysql service sudo service mysqld start You can check the status of the service with sudo service mysqld status Step 5 Log in to MySql mysql -uroot -p found that I need to enter a password but I don’t know it. In fact, when installing MySQL, a password is set for us by default, and the Password Validation Component is installed, which performs policy checks on the password. We can view the default password by entering sudo grep 'temporary password' /var/log/mysqld.log mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!'; mysql>Flush Privileges; This way we can log in with the new password. Step 6 Authorize MySql remote login Method 1: Modify the host of the user table in the MySQL database. mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; mysql>Flush Privileges; Method 2: Authorize remote IP mysql>GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3'IDENTIFIED BY 'mypassword' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES Then you can access it with Navicat: The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to deploy nginx with Docker and modify the configuration file
>>: A brief discussion on how to write beautiful conditional expressions in JS
For Centos installation of MySQL, please refer to...
Due to the limitation of CPU permissions, communi...
introduction Xiao A was writing code, and DBA Xia...
Operation effectCode Implementation html <div ...
Table of contents Overview 1. Define store.js 2. ...
Table of contents Oracle Isolation Levels MySQL I...
1.1 Data Type Overview The data type is a field c...
Table of contents 1 element offset series 1.1 Off...
background: Since the company's projects seem...
There are also two servers: Preparation: Set the ...
1. Server environment configuration: 1. Check dis...
MySQL creates users and authorizes and revokes us...
Preface As one of the best web servers in the wor...
Effect picture: 1. Import files <script src=&q...
Table of contents Preface Confusing undefined and...