Install MySQL above ubuntu

Source: Internet
Author: User

First, install MySQL

1. The installation needs to use the root account, if you do not set the root account, Google. In the process of installing MySQL, you need to set the password of the root account of MySQL, do not ignore it.

sudo apt-get install mysql-serverapt isntall mysql-clientapt Install Libmysqlclient-dev

2. After the installation of the above 3 packages, use the following command to query whether the installation was successful:

sudo netstat-tap | grep MySQL

The query results, as shown, indicate that the installation was successful.

[Email protected]:~# Netstat-tap | grep mysqltcp6       0      0 [::]:mysql              [::]:*       LISTEN      7510/mysqld     
Ways to allow remote users to log in to access MySQL

To use the root user from any host, password: youpassword (your root password) to connect to the MySQL server:

# mysql-u Root-proot
Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' Youpassword ' with GRANT OPTION;

After the operation, remember to perform the following command refresh permissions

FLUSH Privileges

2. Modify the IP bindings in the my.conf

# 进入编辑/etc/mysql/mysql.conf.d/mysqld.conf vi /etc/mysql/mysql.conf.d/mysqld.conf # 修改ip绑定 # 源文件中为: bind -address 127.0.0.1 # 将其修改为: bind -address 0.0.0.0 # 覆盖保存

When connecting MySQL data remotely using the Navicat for MySQL client software, the connection appears 2003-can ' t connect to the MySQL on ' 192.168.1.2 ' (10061) error, because MySQL does not allow remote connections.

Here's how to modify it:

1: Locate the My.ini file under the server MySQL folder. Modify bind-address=127.0.0.1 to bind-address=0.0.0.0

2: Restart the MySQL service.

Test the connection condition:

"1045-access denied for user ' [email protected] (using Password:no)" will appear if the remote login user is not added to the permissions that all machines can access, which indicates the need to add permissions;

Add the following command:

1) Grant all on * * to username @ "%" identified by "password";

2) flush privileges;

By completing the above steps, you can access the MySQL database remotely.

Install MySQL above ubuntu

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.