Ubuntu MySQL installation and configuration remote login tutorial, tumysql

Source: Internet
Author: User

Ubuntu MySQL installation and configuration remote login tutorial, tumysql

This article provides an example of how to install MySQL and configure remote logon for your reference. The details are as follows:

1. Install MySQL

1. Install MySQL

1. sudo apt-get install mysql-server

2. sudo apt-get install mysql-client

3. sudo apt-get install libmysqlclient-dev

Note: during the installation process, you will be prompted to set the password and confirm the password. Remember the password.

After the installation is complete, run the following command to check whether the installation is successful:

root@root:/# ps aux|grep mysqlmysql 9323 1.4 10.3 1115748 138308 ?  Ssl 22:34  0:00 /usr/sbin/mysqldroot 9486 0.0 0.0 21312 928 pts/18 S+ 22:34 0:00 grep --color=auto mysql

The above result indicates that the installation is successful.

Log on to the mysql database using the following command:

Previously, I set the password as root.

root@root:/# mysql -uroot -proot

-U indicates the login user name,
-P indicates the Login User Password

2. configure remote Logon

1. Open the configuration file

root@root:/# sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

2. modify the configuration file

Modify bind-address = 127.0.0.1 to 0.0.0.0 or comment out

3. Add Remote Access Permissions

root@root:/# mysql -uroot -proot->GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password'   WITH GRANT OPTION;->FLUSH PRIVILEGES;

The above user and password can be set to your own

4. Check whether the operation is successful.

 root@root:/# netstat -an | grep 3306 tcp   0   0 0.0.0.0:3306     0.0.0.0:*      LISTEN 

The preceding result indicates that the setting is successful.

5. Restart MySQL

root@root:/# service mysql restart

6. Test the connection

Find the IP address through ifconfig

Test the connection on Navicat

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.