Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./doctrine2-cli.php does not connect to the DB configured #89

Closed
thomas-mangin opened this issue Oct 22, 2013 · 5 comments
Closed

./doctrine2-cli.php does not connect to the DB configured #89

thomas-mangin opened this issue Oct 22, 2013 · 5 comments

Comments

@thomas-mangin
Copy link

the script attempts to connect to the local machine when the database is defined on a remote host.

I am sure it can be fixed with a port forwarding but I would rather not do it as otherwise I will not be able to help with debugging this issue.

@barryo
Copy link
Member

barryo commented Oct 22, 2013

I routinely use this script with a remote database without issue.

Ensure you have correctly set the following in application/configs/applicaton.ini:

resources.doctrine2.connection.options.driver   = 'pdo_mysql'
resources.doctrine2.connection.options.dbname   = 'ixp'  
resources.doctrine2.connection.options.user     = 'ixp'
resources.doctrine2.connection.options.password = 'password'  
resources.doctrine2.connection.options.host     = '127.0.0.1'

@barryo barryo closed this as completed Oct 22, 2013
@thomas-mangin
Copy link
Author

Hi Barry,

Then could you please explain the following behaviour to me ?
Please note the "Access denied for user 'ixpuser'@'ixl1.ixleeds.net' "

Thank you.

Thomas


»› nslookup 109.239.97.61 | grep name
61.97.239.109.in-addr.arpa name = ixl1.ixleeds.net.

»› nslookup 109.239.97.62 | grep name
62.97.239.109.in-addr.arpa name = unassigned.aql.com.

»› ifconfig | grep 109.239.97
inet addr:109.239.97.61 Bcast:109.239.97.63 Mask:255.255.255.240
»› cd /srv/ixp/application/configs/
»› grep resources.doctrine2.connection.options.host application.ini
resources.doctrine2.connection.options.host = '109.239.97.62'
»› cd /srv/ixp/bin/
»› ./doctrine2-cli.php orm:schema-tool:create
ATTENTION: This operation should not be executed in a production environment.

Creating database schema...

[Doctrine\ORM\Tools\ToolsException]
Schema-Tool failed with Error 'SQLSTATE[28000] [1045] Access denied for user 'ixpuser'@'ixl1.ixleeds.net' (using pas
sword: YES)' while executing DDL: CREATE TABLE consoleserverconnection (id INT AUTO_INCREMENT NOT NULL, custid I
NT DEFAULT NULL, switchid INT DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, port VARCHAR(255) DEFAULT NUL
L, speed INT DEFAULT NULL, parity INT DEFAULT NULL, stopbits INT DEFAULT NULL, flowcontrol INT DEFAULT NULL, aut
obaud TINYINT(1) DEFAULT NULL, notes LONGTEXT DEFAULT NULL, INDEX IDX_530316DCDA0209B9 (custid), INDEX IDX_53031
6DCDC2C08F8 (switchid), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB

[PDOException]
SQLSTATE[28000] [1045] Access denied for user 'ixpuser'@'ixl1.ixleeds.net' (using password: YES)

@barryo
Copy link
Member

barryo commented Oct 23, 2013

This is a MySQL permissions issue:

Access denied for user 'ixpuser'@'ixl1.ixleeds.net' (using password: YES)

The user ixpuser from host ixl1.ixleeds.net is not allowed to access MySQL.

I also suspect that from 109.239.97.61 the following won't work (replace variables as configured in your application.ini):

mysql -h 109.239.97.62 -u $user -p$password $database

If it doesn't then you need to issue one or the other of the following (depending on how your DNS is configured) on your MySQL server:

GRANT ALL ON $database.* TO `$user`@`109.239.97.61` IDENTIFIED BY '$password';
GRANT ALL ON $database.* TO `$user`@`ixl1.ixleeds.net` IDENTIFIED BY '$password';

@thomas-mangin
Copy link
Author

Thank you for correcting me. I would love to have a fancy excuse (like with some hosts entry conflicting) .. but nope - strong password and bad copy and paste ... where is the option to delete an issue and hide in shame :-)

@barryo
Copy link
Member

barryo commented Oct 23, 2013

LOL, no worries. And once the issue is closed, no one will notice ;)

barryo pushed a commit that referenced this issue Nov 3, 2017
#89)

* [NF] - ZF -> Laravel: AdminController - closes islandbridgenetworks/IXP-Manager-Archive-Yann#84

* [NF] - ZF -> Laravel: AdminController - closes islandbridgenetworks/IXP-Manager-Archive-Yann#84

* [REVIEW] Formatting, renaming and layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants