• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 `xf-addon:create` Command

#1
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?
 
#3
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.
 

Kirby

Well-known member
#4
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.
 

Kirby

Well-known member
#6
It is, yes. But the environment might be different between webserver and CLI (socket location, libmysql vs. mysqlnd, etc.)
 
Last edited:

Chris D

XenForo developer
Staff member
#7
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.