Remote settings of MySQL Databases in Linux

Source: Internet
Author: User

Remote settings of MySQL Databases in Linux

1. Start the service and log on
[Root @ localhost ~] #/Etc/init. d/mysqld restart
Stopping mysqld: [OK]
Starting mysqld: [OK]
[Root @ localhost ~] # Mysql-u root-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 2
Server version: 5.1.66 Source distribution
Copyright (c) 2000,201 2, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql>

2. Authorize a user who can log on remotely
Mysql> grant all privileges on *. * to tong @ '%' identified by 'system'; -- create a remote user
Query OK, 0 rows affected (0.00 sec)
Mysql> flush privileges; -- Update permission
Query OK, 0 rows affected (0.00 sec)
Mysql>

3. Disable the Firewall
[Root @ localhost ~] #/Etc/init. d/iptables stop
Iptables: Flushing firewall rules: [OK]
Iptables: Setting chains to policy ACCEPT: filter [OK]
Iptables: Unloading modules: [OK]
[Root @ localhost ~] #

4. You can log on with the client tool.
C: \ Users \ Administrator> mysql-h remote IP-u tong-p -- tong is the remote user name
Enter password :******
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 32
Server version: 5.5.19 MySQL Community Server (GPL)
Copyright (c) 2000,201 1, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql>

Error handling:

(1) The firewall is not closed or the firewall does not filter port 3306.

Figure:



Solution:

[Root @ localhost ~] #/Etc/init. d/iptables stop
Iptables: Flushing firewall rules: [OK]
Iptables: Setting chains to policy ACCEPT: filter [OK]
Iptables: Unloading modules: [OK]
[Root @ localhost ~] #

Or:

[Root @ localhost ~] # Vim/etc/sysconfig/iptables -- Add the following line
-A input-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT

(2) Incorrect password

Figure:



Solution: enter the correct password. If the password is forgotten, modify it in the server system.

Installation and remote settings of MySQL in Linux

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.