宇宙主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

欧基零壹微头条IP归属甄别会员请立即修改密码
查看: 1852|回复: 9

远程数据库棘手的问题

[复制链接]
发表于 2012-7-6 13:56:51 | 显示全部楼层 |阅读模式
今天搬迁了网站,   因为程序的原因, vps必须得打开远程数据库。

用phpmyadmin创建数据库时  主机输入的是% 账号密码和以前一样,  vps上测试一切正常, 但另一个vps使用远程数据库连接到本机时却死活连接不上 这是为啥
发表于 2012-7-6 13:57:53 | 显示全部楼层
有些在my.cnf中禁止了远程 自己检查

评分

参与人数 1威望 +15 收起 理由
elves766 + 15 求方法

查看全部评分

发表于 2012-7-6 14:00:35 | 显示全部楼层
/etc/my.cnf

skip-networking
再前面加个#

评分

参与人数 1威望 +10 收起 理由
elves766 + 10 很给力!

查看全部评分

发表于 2012-7-6 14:03:19 | 显示全部楼层
看三楼
 楼主| 发表于 2012-7-6 14:07:10 | 显示全部楼层
百度 发表于 2012-7-6 14:00
/etc/my.cnf

skip-networking

#
# 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]
skip-locking
skip-innodb
#
# * Basic Settings
#
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
language        = /usr/share/mysql/english
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/
发表于 2012-7-6 14:07:48 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2012-7-6 14:27:36 | 显示全部楼层
elves766 发表于 2012-7-6 14:07
#
# The MySQL database server configuration file.
#

还没有解决吗?
试试telnet ip 3306
 楼主| 发表于 2012-7-6 22:29:33 | 显示全部楼层
百度 发表于 2012-7-6 14:27
还没有解决吗?
试试telnet ip 3306

恩恩解决了 上午单位有事就没上 今天分没了 明天不给你哈
发表于 2012-7-6 22:46:35 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2012-7-6 22:50:58 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|FastFib VPS论坛

GMT+8, 2024-9-20 19:53 , Processed in 0.089078 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表