mnogoclient + mysql can't connect to DB when trying to automatically configure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mnogosearch (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mnogosearch-common
1. Ubuntu 8.04.1
2. mnogosearch-client & mnogosearch-mysql v. 3.3.6-1ubuntu0.1
3. Connects to database and runs the included scripts
4. MySQL driver: #1045: Access denied for user 'root'@'localhost' (using password: NO)
I basically wanted to experiment with mnogosearch on my own local computer, so I set up mysql with a basic root/root account with access to everything. I'm aware that's not the most secure way to do things, but since it has no access to the outside world, I don't really care. I then installed mnogo-common and mnogo-mysql. When it got to the configuration part, I selected the following options:
Overwrite Config Files: yes
Indexing: blob
Database: mysql
Username/Pass: mnogosearch/
DB Name: mnogosearch
Is database local?: Yes (I have also tried saying 'no' and then using localhost/3306 for the host/port with the same results)
Automatically configure DB?: Yes
DB Admin user/pass: root/root
End result:
MySQL driver: #1045: Access denied for user 'root'@'localhost' (using password: NO)
14 queries sent, 0 succeeded, 14 failed
It's as if I had not typed in anything for the password, since I then tried
$ mysql --user=root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
$ mysql --user=root --password=root
Welcome to MySQL (blah blah blah)
mysql>
What's going on?
I have also encountered this issue in mnogosearch- common_ 3.3.7-3 on Jaunty. What is happening is the .deb packages config script prompts you for your configuration settings, but at the very end it erases the passwords you have supplied. When the postinst script runs, it expects the passwords to be in the debconf database, but they are not. This causes all the database calls to fail when the postinst script runs '/usr/sbin/indexer -Edrop' and '/usr/sbin/indexer -Ecreate'. The call to '/usr/sbin/ mnogosearchconf ig' also creates the config files (indexer.conf and search.htm) with missing passwords in the DBAddr command.
The solutions seems to be to move the clearing of the passwords from the config script into the postinst script.
If the package is already installed, modifying the scripts /var/lib/ dpkg/info/ mnogosearch- common. config and /var/lib/ dpkg/info/ mnogosearch- common. postinst, then running 'dpkg-reconfigure mnogosearch-common' will setup the database and config files properly.