XF 2.0 `xf-addon:create` Command

Tom

Active member
Whenever I attempt to use the php cmd.php xf-addon:create command within the CLI, I am met by the following SQL error:
Access denied for user 'root'@'localhost' (using password: YES)

However, on the frontend site everything is working fine, including the database. Any ideas as to what could be causing this?
 
Hmm ... root is the user from your config.php and it does have permission to connect from localhost?
 
Hmm ... root is the user from your config.php and it does have permission to connect from localhost?
Yup, and the fact that everything is working just fine on the frontend suggests that there are no issues with initiating a connection to the DB.
 
Assuming that the mysql commandline client is installed i would check if mysql -h localhost -u root -p succeeds.

If it does not then there must be a problem with the mysql user permissions.

If it does ... that would be somewhat strange.
 
It is, yes. But the environment might be different between webserver and CLI (socket location, libmysql vs. mysqlnd, etc.)
 
Last edited:
Aside from making sure you've actually got the correct XF root set as your current working directory in your shell, you might also want to check whether php is the version you are expecting by running php -v.

If the version listed there is different to that shown when you go to admin.php?tools/phpinfo then there could be differences in the PHP configuration which could be causing this.
 
Top Bottom