我正在尝试通过ssh对bitnami的wordpress多层堆栈进行数据库管理,特别是我想导出并进行初始导入(尽管我可能只会创建一个新的数据库)。
运行以下命令时,出现以下错误:
命令: mysqldump -u root -p bitnami_wordpress > bitnami_wordpress.sql
输出: mysqldump: Got error: 2002: "Can't connect to local MySQL server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2)" when trying to connect
这还会在我的主目录中创建一个0b sql文件。
命令: mysqladmin -u root -p status
(我输入密码)
输出:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket .
'/opt/bitnami/mariadb/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket:
'/opt/bitnami/mariadb/tmp/mysql.sock' exists!
命令: cd /opt/bitnami/mariadb/
+ ls
输出:
bin CREDITS include licenses README-wsrep
COPYING data INSTALL-BINARY plugin sbin
COPYING.thirdparty EXCEPTIONS-CLIENT lib README.md share
命令: sudo find . -name mysql
输出:
./root/.nami/components/com.bitnami.mysql-client/lib/databases/mysql
./root/.nami/components/com.bitnami.mysql-client/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.libphp/lib/databases/mysql
./root/.nami/components/com.bitnami.libphp/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.wordpress/lib/databases/mysql
./root/.nami/components/com.bitnami.wordpress/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.php/lib/databases/mysql
./root/.nami/components/com.bitnami.php/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.apache/lib/databases/mysql
./root/.nami/components/com.bitnami.apache/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.mariadb/lib/databases/mysql
./root/.nami/components/com.bitnami.mariadb/lib/handlers/databases/mysql
./opt/bitnami/mysql
./opt/bitnami/mysql/bin/mysql
./opt/bitnami/mariadb/include/mysql
./opt/bitnami/mariadb/include/mysql/server/mysql
./opt/bitnami/mariadb/include/mysql/mysql
./opt/bitnami/mariadb/bin/mysql
./usr/share/bash-completion/completions/mysql
命令:
find /opt/bitnami/mysql/ -name "*.cnf"
输出:无
find /opt/bitnami/mariadb/ -name "my.cnf"
输出:
/opt/bitnami/mariadb/share/my-medium.cnf
/opt/bitnami/mariadb/share/my-small.cnf
/opt/bitnami/mariadb/share/my-large.cnf
/opt/bitnami/mariadb/share/my-innodb-heavy-4G.cnf
/opt/bitnami/mariadb/share/my-huge.cnf
/opt/bitnami/mariadb/share/wsrep.cnf
命令: nano /opt/bitnami/mariadb/share/my-medium.cnf
(我的中号、小号和大号有什么区别)?
输出:
# The following options will be passed to all MariaDB clients
[client]
# password = your_password
port = 3306
socket = /opt/bitnami/mariadb/tmp/mysql.sock
注: /opt/bitnami/mariadb/tmp/mysql.sock
不存在。
我浏览了一下mariadb关于2002年错误的文档,但是我似乎没有相同的.conf文件(我也不知道在哪里查找)
…从这里我不知道去哪里,我只通过shell做了有限的数据库管理。
简明问题:
如何导出数据库而不出现2002错误?
如何覆盖/更新数据库?
任何帮助将不胜感激,并提前感谢!
1条答案
按热度按时间aiazj4mn1#
比特纳米的人过来了。我接错了主机。
查找主机:
sudo cat /opt/bitnami/wordpress/wp-config.php | grep 'DB_HOST'
要导出:mysqldump -h provisioner-peer -u root -p bitnami_wordpress > bitnami_wordpress.sql