Ubuntu16.04 installing MySQL and configuring remote access

Source: Internet
Author: User

1. Install MySQL

A, install the service side

sudo apt-get install Mysql-server

B. Set Root user

sudo passwd

C, install the client

sudo apt-get install mysql-client

D. See if MySQL is installed successfully

sudo netstat-tap | grep MySQL

2. Configure Remote Access

A. Edit the configuration file

sudo vi/etc/mysql/mysql.conf.d/mysqld.cnf will bind-address = 127.0.0.1 comments

B. Modify user Permissions

Login Mysql:mysql-u root-p--Remote access mysql-h 192.168.0.201-p 3306-u root-p123 123 is the root user password

User rights: Grant all on * * to [email protected] '% ' identified by ' 1 '; --Add a remote access user with a username of root and a password of 1

Refresh: Flush privileges;

To see if the add succeeds: select user,host,authentication_string from User; --In 5.7 The user password is column authentication_string

Quit: Quit

C. Restart MySQL Service

/etc/init.d/mysql restart

3, complete and test pass.

Ps:

Attach VI editing points: Click I to enter the edit mode, press the ESC key to enter: wq! (Save and Exit VI edit mode)

MySQL Uninstall:

1, sudo apt-get autoremove--purge mysql-server-5.0
2, sudo apt-get remove mysql-server
3, sudo apt-get autoremove mysql-server
4, sudo apt-get remove Mysql-common-this is very important

5, Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p--clear residual data

Ubuntu16.04 installing MySQL and configuring remote access

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.