Fedora26 Mysql Open Remote Link service

Source: Internet
Author: User

Download and install MySQL

Install with the following command

$ dnf install mysql-server

Note: Fedora is installed by default mariadb

After the installation is complete, test with the following command

$ mysql --version
Open 3306 Ports

First enter the following command to open the MySQL service

$ sudo systemctl start mariadb

Then use the following command 3306 to query the port case

$ netstat -an | grep 3306

If you do not show

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               

The description is open.
Otherwise, it is not open. Execute the following command:

$ sudo vim /etc/my.conf    #(后面为注释不需要输入)打开my.conf

Found it

# localhost which is more compatible and is not less secure.bind-address  = 127.0.0.1

Will bind-address = 127.0.0.1 be # commented out, i.e. the two lines above become

# localhost which is more compatible and is not less secure.# bind-address  = 127.0.0.1

Finally restart the MySQL service

$ sudo systemctl restart mariadb
Assigning permissions for remote logins

Log in to MySQL

$ mysql -uroot -p

Then select the database

use DATABASES_NAME

Assigning permissions:

/*root用户可以使用密码123从任何地方访问*/GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123' WITH GRANT OPTION; FLUSH   PRIVILEGES; #刷新生效/*root用户可以使用密码123从192.168.1.3访问*/GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.3' IDENTIFIED BY '123' WITH GRANT OPTION;FLUSH   PRIVILEGES;/*root用户可以使用密码123从192.168.1.3访问mydb数据库*/GRANT ALL PRIVILEGES ON  mydb.* TO 'root'@'192.168.1.3' IDENTIFIED BY '123' WITH GRANT OPTION;FLUSH   PRIVILEGES;

done!

Telnet

The instructions are as follows:

$ mysql -u 用户名 -p -h 服务器IP地址 -P 服务器端MySQL端口号 (-D 数据库名)    # ()内可有可无

Fedora26 Mysql Open Remote Link service

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.