您好,
首先,感谢您提供这份出色的指南。我非常感激为此付出的努力。
关于我的问题:
我在运行导入脚本时遇到了连接数据库的问题,尽管我使用的是 MariaDB 来存储 vBulletin 的备份数据,而不是 MySQL。我已经确认 MariaDB 正在运行,我也成功将 vBulletin 的备份数据导入其中,并且对脚本中的用户名、主机名和密码进行了四次核对,但依然无法成功。
我觉得自己可能忽略了某个简单的细节,如果有人能指点我一下,那将非常有帮助。
我使用的版本如下:
mysql2 0.5.2
mariadb-server-10.3
discourse master git commit cb8fa46
详细描述如下:
当我尝试运行以下命令时:
apt-get update && apt-get install libmysqlclient-dev mysql-server-5.7
我收到了以下错误:
E: Package 'libmysqlclient-dev' has no installation candidate
E: Package 'mysql-server-5.7' has no installation candidate
这很合理,也许这些软件包在此时已从仓库中移除。
因此,我改为运行:
apt-get update && apt-get install mariadb-server-10.3 libmariadbd-dev
MariaDB 作为直接替代品运行良好,所有步骤都顺利执行,直到我尝试运行迁移脚本时出现以下错误:
root@discourse:/src# su discourse -c 'bundle exec ruby script/import_scripts/vbulletin.rb'
root:@localhost wants vb4
Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...
==================================================
Access denied for user 'root'@'localhost'
Cannot connect in to database.
Hostname: localhost
Username: root
Password:
database: vb4
Edit the script or set these environment variables:
export DB_HOST="localhost"
export DB_NAME="vbulletin"
export DB_PW=""
export DB_USER="root"
export TABLE_PREFIX="vb_"
export ATTACHMENT_DIR '/path/to/your/attachment/folder'
Exiting.
关于权限问题:
root@discourse:/src# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 59
Server version: 10.3.17-MariaDB-0+deb10u1 Debian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show grants;
+------------------------------------------------------------------------------------------------+
| Grants for root@localhost |
+------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION |
| GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION |
+------------------------------------------------------------------------------------------------+
2 rows in set (0.000 sec)
我已经多次仔细检查了用户名和密码,甚至手动设置过它们。
