惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
S
Secure Thoughts
P
Palo Alto Networks Blog
Google DeepMind News
Google DeepMind News
AI
AI
H
Hacker News: Front Page
Schneier on Security
Schneier on Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cloudbric
Cloudbric
TaoSecurity Blog
TaoSecurity Blog
T
Tor Project blog
L
LINUX DO - 热门话题
Cyberwarzone
Cyberwarzone
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
S
Security @ Cisco Blogs
S
Security Affairs
P
Privacy International News Feed
I
Intezer
S
SegmentFault 最新的问题
F
Full Disclosure
H
Heimdal Security Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Securelist
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Security Latest
Security Latest
C
Cybersecurity and Infrastructure Security Agency CISA
Attack and Defense Labs
Attack and Defense Labs
Forbes - Security
Forbes - Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
InfoQ
WordPress大学
WordPress大学
Vercel News
Vercel News
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
美团技术团队
IT之家
IT之家
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
D
Docker
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Hugging Face - Blog
Hugging Face - Blog

WMI

ESLint Flat Config for JS, TS, React, and Prettier - WMI Yarn NPM Registry Configuration - WMI Yarn Guides - WMI Set Up ADB Wireless Debugging on Android: A Full Guide - WMI How to Fill Tax Information on Google Adsense - WMI Migrate ESLint v9 for prettier typescript javascript - WMI PySide6 button click open new window - WMI PySide6 autocomplete input text - WMI Mobile Legends To The Stars Event Clue - WMI [PHP] generate random proxy IP:PORT from CIDR - WMI [PHP] generate big text file for testing purpose - WMI List of Chrome Driver command line arguments - WMI Happy eid mubarak - WMI Install markdown engine on vite ESM typescript - WMI Android Activity lifecycle - WMI OkHttp cookie handling on android (webview supported) - WMI Turn git log history into markdown - WMI enable automatic memory heap resizing of android studio - WMI is defining screen density can reduce build time ? - WMI
How to Activate MySQL for Multiple Devices - WMI
Dimas Lanjaka · 2025-08-24 · via WMI

How to Activate MySQL for Multiple Devices

This tutorial will guide you through the steps to allow multiple devices to access your MySQL server over a network.

Prerequisites

  • MySQL server installed on your host machine
  • Access to the MySQL root user or an admin account
  • Basic knowledge of networking

Configure MySQL to Listen on All IP Addresses

  1. Open the MySQL configuration file (my.cnf or my.ini).
    • On Windows: Usually located at C:\ProgramData\MySQL\MySQL Server X.X\my.ini
    • On Linux: Usually at /etc/mysql/my.cnf or /etc/my.cnf or /etc/mysql/mysql.conf.d/mysqld.cnf
  2. Find the line starting with bind-address.
    bind-address        = 127.0.0.1
    mysqlx-bind-address = 127.0.0.1
  3. Change it to:
    bind-address        = 0.0.0.0
    mysqlx-bind-address = 0.0.0.0
    This allows MySQL to accept connections from any IP address.
  4. Save the file and restart the MySQL service.
    • Windows:
      net stop mysql
      net start mysql
    • Linux:
      sudo systemctl restart mysql

Allow Remote Connections in the Firewall

  1. Open port 3306 (default MySQL port) in your firewall settings.
    • Windows: Use Windows Defender Firewall to allow inbound connections on port 3306.
    • Linux:
      sudo ufw allow 3306/tcp

Create a MySQL User for Remote Access

⚠️ Important: At this point MySQL will accept connections from anywhere. If your server is exposed to the internet, secure it:

  1. Log in to MySQL as root:
    mysql -u root -p
  2. Create a new user or update an existing user to allow access from a specific IP or any IP (%):
    CREATE USER 'username'@'%' IDENTIFIED BY 'password';
    GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
    FLUSH PRIVILEGES;

    Replace username and password with your desired credentials.

Connect from Another Device

On the client device, use the following command to connect:

mysql -h <server-ip-address> -u username -p

Replace <server-ip-address> with the IP address of your MySQL server.

Optimizations

Increase Packet Size Limit

edit: /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
max_allowed_packet = 128M
net_read_timeout = 120
net_write_timeout = 120

check using:

SHOW VARIABLES LIKE 'max_allowed_packet';
SHOW VARIABLES LIKE 'net_read_timeout';
SHOW VARIABLES LIKE 'net_write_timeout';

Increase Connection Limit

edit: /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
max_connections = 500
wait_timeout = 60
interactive_timeout = 60

check using

SHOW VARIABLES LIKE 'max_connections';
SHOW STATUS LIKE 'Threads_connected';
SHOW STATUS LIKE 'Threads_running';

Security Tips

  • Only allow trusted IPs if possible (replace % with a specific IP or subnet).
  • Use strong passwords for all MySQL users.
  • Consider enabling SSL for encrypted connections.

You have now enabled MySQL access for multiple devices on your network!