Ubuntu Server installs MySQL and configures remote connections

Source: Internet
Author: User
Tags mysql in

1. Install MySQL in Ubuntu Server (remember to set the password in the process)

Sudo apt-get Install MySQL

Sudo Apt-get Install Mysql-server

Sudo Apt-get Install Mysql-client

Note: There is a problem with MySQL not installed here, prompting Dpkg:error processing package open-vm-tools (--configure) error, the workaround is to clear open-vm-tools after reinstalling, sudo Apt-get purge open-vm-tools, sudo apt-get install Open-vm-tools.

2. Configure the MySQL Connection account

Enter the MySQL environment (Mysql–u root–p)

User MySQL

Add an Account

(INSERT into Mysql.user (Host,user,password) VALUES ("localhost", "Test", Password ("pass"));)

localhost refers to the local, if remote connection is required, the host can be set to "%"

Note: When using a user to enter the MySQL environment, you are prompted with an access denied problem, the workaround is to update the Authentication_string field in the Mysql.user table, and the update mysql.user set Authentication_string=password (' Pass ') where user= ' test ' and host= ' localhost '

3. Authorization of the user

Command: Grant all privileges the Databasename.tablename to ' test ' @ ' localhost ' identified by ' Pass ' with GRANT option;

DatabaseName-database name, tablename-table name, if you want to grant the user permission to operate on all databases and tables, the * representation is available *, such as *. *

@ after referring to the host, need to all add @ '% '

4. Remote use SQLYOG connection, port default 3306

Note: The error in connection Tip 1045 is encountered here, the workaround is to set the Mysql.user table to the corresponding user, host to connect with IP, and set authentication_string and authorize this user

Ubuntu Server installs MySQL and configures remote connections

Related Article

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.