是否有MySQL命令来定位my.cnf配置文件,类似于PHP的phpinfo() 定位方式php.ini?
此问题与以下问题有关:
我正在本地计算机上配置一个新的MySQL(5.1)服务器.我需要提供对数据库的远程访问.我做了以下步骤:
bind-address在my.cnf中评论:
# bind-address = 192.168.1.3
Run Code Online (Sandbox Code Playgroud)授予权限:
GRANT ALL PRIVILEGES ON *.* TO 'nickruiz'@'%' IDENTIFIED BY PASSWORD 'xxxx';
Run Code Online (Sandbox Code Playgroud)为防火墙配置iptables
sudo iptables -I INPUT -p udp --dport 3306 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 3306 --syn -j ACCEPT
sudo iptables-save
Run Code Online (Sandbox Code Playgroud)重启mysql服务器 sudo /etc/init.d/mysql restart
测试时,我得到以下内容:
LAN:
mysql -h 192.168.1.3 -u nickruiz -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 95
Server version: 5.1.63-0ubuntu0.11.04.1 (Ubuntu) …Run Code Online (Sandbox Code Playgroud) 我的10.04 ubuntu盒子上有一个chroot环境.我正试图在这个chroot环境中运行mysql,但是我收到了这个错误.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Run Code Online (Sandbox Code Playgroud)
基本上我使用debootstrap和schroot来创建chroot.然后我在这个chroot环境中安装了"ubuntu-minimal"和mysql-server.如果您对此感兴趣,请执行以下步骤:https://help.ubuntu.com/community/DebootstrapChroot.但是mysql在chroot中不起作用./var/log/mysql.log和/var/log/mysql.err文件为空,mysqld服务器正在运行.有什么指针吗?
我正在尝试将我的机器上运行的 wordpress 连接到在我的机器(localhost)上通过隧道传输的远程 mysql 数据库。数据库连接通过向mysqlCLI 客户端提供以下参数来工作
$ mysql --protocol=TCP -P 10000 -h localhost -u username -p'password' db_name
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 93438893
Server version: 5.5.8-log Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark …Run Code Online (Sandbox Code Playgroud)