How to install MySQL on a lunix cloud server for remote connection

Source: Internet
Author: User
Tags gz file lunix

Talk about installing MySQL on this server is really a big hole ah! I do not know how the whim of the purchase of a Baidu cloud server, and then think about it to do some of their small projects are running up. Hey... In fact, just want to show off, write some small application to not programming friends to use, to meet my own small mind, ah, I digress, a little stop to run off, continue to say the installation of things.

Online Baidu has a lot of tutorials, that call a pit Ah! Everything went well when I first started to install the JDK and Tomcat. I didn't know my server was different or my operation was wrong until I started loading MySQL! Anyway is all kinds of not, that call a depressed. Various methods what decompression tar.gz file, with what yum,rpm online tutorial have tried a time is not installed there is a problem is the download problem (do not know if I have a problem in the network, to the MySQL official website to download, that speed, heart tired ~ ~ ~)

Preparation tools:

Xshell5 (for), XFTP, CENTOS7 64-bit Cloud Server System (LIUNX)

The Rhel/centos series Linux operating system itself does not have the source of MySQL and needs to download and install itself. This article describes how to install the mysql5.7.x database

Specific steps:

Step one: Connect to the server

Open Xshell Connect your server, enter the IP, port (Basic is the default 22 port), OK, and then jump back to enter the account Password page I will not be one.

Log into the server to access this page:

Step two: Find MySQL resources

URL of the resource : http://repo.mysql.com/

Here's what I'm using: http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm (copy this address)

 Note: Select mysql57-community-releasexxx start, do not choose mysql-community-releasexxx that, with 57 is the mysql5.7 version .

  

Step three: Download the installation package from the command line (recommended to download from the command line at the server, this is a very fast and heinous)

After installing the mysql5.7 source, there will be two more files in the/ETC/YUM.REPO.D directory

Mysql-community.repo and Mysql-community-source.repo

By using xftp (the File Upload tool used in conjunction with Xshell), you can see more files like the following

    

Step four: Install the MySQL program

[[email protected] YUM.REPOS.D] #yum install Mysql-server

    

Step Five: Initialization of the database

[Email protected] ~]# mysqld--initialize [[email protected] ~]# mysqld--user=root

MySQL generates temporary password after initialization (/var/log/mysqld.log)

With the VI command (VI is a powerful text editor with Liunx, just like the txt text edit box in Windows) you can open the view to the password, remember this password, etc. will be used when resetting the password

      

To modify the initial password for the database:

1 [[email protected] ~]# mysqladmin-u root-p Password

    

At this point, the installation of MySQL and password modification has been completed, but when the preparation through the Navicat and other external remote connection of the database software, it is impossible to connect, because you do not authorize the remote connection database permissions

Let's start by setting up how to connect to the remote database!

     

Step Seven: Authorizing remote database connections

There's a lot of this, and I'm going to introduce a fairly simple way to do it.

You can use the following method if you want to connect to the MySQL server from any host with YourPassword (the user name of the remote connection), using the password (to write your remote connection):

1  GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘YourPassword‘ WITH GRANT OPTION;

    

Note: This article is only for learning communication use, this tutorial has a reference Feinifi blog, if necessary, can be viewed through this link.

How to install MySQL on a lunix cloud server for remote connection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.