以root用户编辑 /etc/mysql/my.cnf 文件如下:
/////////////////////////////////////////////////////
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
#
# * IMPORTANT
# If you make changes to these settings and your system uses apparmor, you may
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
////////////////////////////////////////////////////////////////////////////////////////////////////
注意上面的红色代码,只要注释了就OK了!
分享到:
相关推荐
无法远程访问Mysql的解决方案 Mysql 是一种关系型数据库管理系统,广泛应用于各种 web 应用程序中。然而,在实际应用中,我们常常会遇到无法远程访问 Mysql 的问题,这是由于 Mysql 的安全机制所致。下面我们将详细...
主要为大家详细介绍了linux下mysql开启远程访问权限,防火墙开放3306端口,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
针对上述问题,我们可以采取以下步骤来解决MySQL远程访问问题: ##### 1. 修改MySQL配置文件 - **Windows环境**:找到`my.ini`文件(通常位于安装目录下),在`[mysqld]`部分添加以下行: ```ini [mysqld] skip...
这款软件提供了一个Windows平台的界面,可以通过网络连接远程访问Linux服务器上的MySQL数据库,极大地简化了数据库管理和维护的过程。 首先,要使用MySQL-Front远程访问Linux数据库,你需要确保以下几点: 1. **...
设置MySQL远程访问是一项重要的任务,特别是对于需要从不同网络位置或服务器上连接到数据库的应用程序。以下将详细介绍如何允许MySQL数据库接受远程连接。 首先,理解MySQL远程访问的基础知识。默认情况下,MySQL仅...
在MySQL数据库管理中,远程访问连接允许用户从不同的计算机或网络位置访问数据库,这对于多用户协作、分布式系统或云服务的实现至关重要。本教程将详细解释如何设置MySQL以允许指定IP地址的远程访问连接。 首先,...
#### 一、MySQL开启远程访问 **1. 登录本地MySQL** 首先确保你已经安装并启动了MySQL服务。打开命令行工具(如Windows的CMD或Linux的Terminal),输入以下命令登录MySQL: ```sql mysql -u root -p ``` ...
linux环境下开启Mysql远程访问(关闭防火墙).txt
Linux中设置mysql的远程连接,mysql安装完后需要设置远程连接,才能正常通过网络进行访问数据库
Linux 下安装 MySQL 服务器 ...安装和配置 MySQL 服务器需要完成多个步骤,包括安装客户端和服务器端,设置数据库字符集和端口号,启动和停止服务,设置开机启动,解决启动报错问题,登录和忘记密码,允许远程访问等。
文档详细记录了如何在linux环境中将mysql开启远程访问
### Linux开启MySQL远程连接详解 #### 一、背景介绍 随着云计算和大数据技术的发展,Linux作为服务器操作系统的优势日益凸显,而MySQL作为一款广泛使用的开源关系型数据库管理系统,在Linux环境下更是得到了广泛...
- 使用NaviCat连接远程Linux MySQL数据库时遇到10061未知故障的解决方案。 - 通过NaviCat远程连接SQL Server并转换成MySQL的详细步骤。 - 解决NaviCat无法远程连接MySQL的问题。 - MySQL数据库的安装以及与NaviCat ...
在安装MySQL后,进行初始设置至关重要,尤其是为root用户设置安全密码和允许远程访问,以便于管理和维护数据库。以下将详细介绍这两个关键步骤。 首先,让我们讨论如何初始化MySQL的root密码。在MySQL安装后,默认...
在Linux系统中,尤其是对于那些需要提供远程数据库服务的服务器,开启MySQL的远程访问功能是至关重要的。以下是一个详尽的指南,解释如何在Ubuntu Linux上实现这一目标。 首先,我们要确保MySQL服务已经正确安装...
2. **Linux下MySQL外部远程访问配置**:与上述过程相同,但可能需要额外考虑Linux系统的安全设置。 3. **Linux中的MySql数据库远程连接教程**:可能包含更详细的系统环境配置和故障排查指南。 4. **解决MySQL不同意...
首先,我们需要确保你的Linux服务器已经配置好了一些基本的环境,包括SSH远程访问、网络连接以及必要的权限。通常,Linux发行版如Ubuntu、CentOS或Debian都会提供基础的软件包管理器,如`apt`、`yum`或`dnf`,用于...
在Linux环境下安装MySQL数据库系统及配置远程访问功能是IT领域中的常见需求,尤其对于服务器管理和应用部署至关重要。本文将详细解析这一过程中的关键步骤和技术要点,帮助读者掌握在Linux操作系统中如何成功安装...
在Linux环境下部署MySQL 5.7并配置远程访问是一个常见的任务,尤其对于开发人员和系统管理员来说。以下是一个详细的步骤指南: 首先,我们需要在Linux服务器上添加MySQL的Yum库。MySQL的Yum仓库允许我们通过包管理...