Home Database Mysql Tutorial 精细讲解远程安全如何使用MySQL GUI工具_MySQL

精细讲解远程安全如何使用MySQL GUI工具_MySQL

Jun 01, 2016 pm 02:04 PM
mysql use how Safety tool explain Remotely

mysqlGUImysql管理工具

 

MySQL作为数据库,简直就是易用的代名词,绝大多数数据库驱动的web应用程序都选择它做为自己的数据库。正因如此,MySQL被应用于很多WEB服务器上。虽然说MySQL的命令行工具确实有用,但要它完成任务有时实在是在跟时间过不去,除非你对SQL语法已经通吃,熟到炉火纯青的地步。正是由于这个原因,像PhpMyAdmin之类的工具已经变得如此流行。

 

MySQL开发者们已经开始使用他们自己的GUI工具,它们能够用来和本地或远程的MYSQL数据库进行连接。这些工具包括MySQL Administrator、MySQL Query Browser、以及MySQL Workbench。它们都是不错的图形界面的工具,简化了对MySQL数据库的创建和操作。

 

使用这些工具操作远程数据库的问题是,它们通常要求你使MySQL对WEB接口进行监听;而大多数MySQL管理员只会选择对本地主机或某个套接字开启MySQL监听,而不会允许远程连接。这是很好的安全习惯;可是,它让你不花出一点点努力就别想舒舒服服地远程使用这些GUI工具。这里使用ssh隧道[2](tunnel)进行连接效果极好。它不仅允许高强度验证和加密,而且对于MySQL只监听本地连接的设定也毫不妥协。

首先,必须要保证MySQL监听本地主机[2](默认情况下它只监听本地套接字上的连接),这可以通过告诉MySQL允许WEB连接并重新启动服务器来实现。MySQL应该配置成只监听loopback接口,或者本地接口,或者WEB接口。

 

接下来,编辑你希望用来发起连接的主机上的~/.ssh/config文件,并插入如下内容:

 

<ccid_code></ccid_code>Host remotesql

?Hostname webserver.domain.com

?User joe

?LocalForward *:13306 localhost:3306
Copy after login

 

这会以用户joe连接webserver.domain.com,并且把本地系统上的13306端口转发(forward)到webserver.domain.com的3306端口(这是标准MySQL端口)。注意我们没有把被转发端口和本地机器上的本地接口进行绑定,而是指向了所有接口;这就是说我们可以连上me.domain.com的13306端口(假设me.domain.com是本地工作站的名字),而不是去连接本地主机上的13306端口(这很重要,因为这些GUI工具会试图使用一个套接字来连接本地主机,而这不是我们希望的。)现在你可以发起连接,方法是执行:

 

<ccid_code></ccid_code>$ ssh -f -N remotesql
Copy after login

 

最后,激活MySQL的管理员账户,并且通过你的信任证书,让它连接me.domain.com的13306端口(而不管它是用户账户还是根账户)。为了正常连接,你可能不得不给user@localhost.localdomain许可。

 

这样做之后,你将能够使用本地WEB上的任何一个系统,跨越Internet而又毫无风险的连接远程数据库(除非本地机器上防火墙规则阻止了它),这样之后,你仍然可以使用本地的MySQL命令行工具操作远程数据库:

 

 

<ccid_code></ccid_code>$ mysql -u root -p -h me.domain.com -P 13306
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1269
29
C# Tutorial
1248
24
How reliable is Binance Plaza? How reliable is Binance Plaza? May 07, 2025 pm 07:18 PM

Binance Square is a social media platform provided by Binance Exchange, aiming to provide users with a space to communicate and share information related to cryptocurrencies. This article will explore the functions, reliability and user experience of Binance Plaza in detail to help you better understand this platform.

MySQL vs. phpMyAdmin: Understanding the Key Differences MySQL vs. phpMyAdmin: Understanding the Key Differences May 06, 2025 am 12:17 AM

MySQL is a database management system, and phpMyAdmin is a web tool for managing MySQL. 1.MySQL is used to store and manage data and supports SQL operations. 2.phpMyAdmin provides a graphical interface to simplify database management.

MySQL vs. Oracle: Understanding Licensing and Cost MySQL vs. Oracle: Understanding Licensing and Cost May 03, 2025 am 12:19 AM

MySQL uses GPL and commercial licenses for small and open source projects; Oracle uses commercial licenses for enterprises that require high performance. MySQL's GPL license is free, and commercial licenses require payment; Oracle license fees are calculated based on processors or users, and the cost is relatively high.

phpMyAdmin's Function: Interacting with MySQL (SQL) phpMyAdmin's Function: Interacting with MySQL (SQL) May 07, 2025 am 12:16 AM

phpMyAdmin simplifies MySQL database management through the web interface. 1) Create databases and tables: Use graphical interface to operate easily. 2) Execute complex queries: such as JOIN query, implemented through SQL editor. 3) Optimization and best practices: including SQL query optimization, index management and data backup.

MySQL: The Engine, phpMyAdmin: The User Interface MySQL: The Engine, phpMyAdmin: The User Interface May 04, 2025 am 12:02 AM

MySQL and phpMyAdmin are powerful database tools, and their combination provides convenience for database management. MySQL's high performance, scalability and security make it the first choice for database engines, while phpMyAdmin's database management, data import and export, and user management capabilities simplify database operations. The actual case shows how they work together, and provides optimization strategies such as index optimization, query optimization, caching mechanism and phpMyAdmin configuration tuning to improve performance.

Navicat and MySQL: A Perfect Partnership Navicat and MySQL: A Perfect Partnership May 05, 2025 am 12:09 AM

Navicat and MySQL are perfect matches because they can improve database management and development efficiency. 1.Navicat simplifies MySQL operations and improves work efficiency through graphical interfaces and automatic generation of SQL statements. 2.Navicat supports multiple connection methods, which facilitates local and remote management. 3. It provides powerful data migration and synchronization capabilities, suitable for advanced usage. 4.Navicat helps with performance optimization and best practices such as regular backup and query optimization.

MySQL: A Practical Application of SQL MySQL: A Practical Application of SQL May 08, 2025 am 12:12 AM

MySQL is popular because of its excellent performance and ease of use and maintenance. 1. Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2. Insert and query data: operate data through INSERTINTO and SELECT statements. 3. Optimize query: Use indexes and EXPLAIN statements to improve performance.

Comparing SQL and MySQL: Syntax and Features Comparing SQL and MySQL: Syntax and Features May 07, 2025 am 12:11 AM

The difference and connection between SQL and MySQL are as follows: 1.SQL is a standard language used to manage relational databases, and MySQL is a database management system based on SQL. 2.SQL provides basic CRUD operations, and MySQL adds stored procedures, triggers and other functions on this basis. 3. SQL syntax standardization, MySQL has been improved in some places, such as LIMIT used to limit the number of returned rows. 4. In the usage example, the query syntax of SQL and MySQL is slightly different, and the JOIN and GROUPBY of MySQL are more intuitive. 5. Common errors include syntax errors and performance issues. MySQL's EXPLAIN command can be used for debugging and optimizing queries.

See all articles