Solved this issue. When I created the user 'root'@'10.10.10.3' on the
MySQL server, I used this command:
GRANT ALL PRIVILEGES ON rt4.* TO 'root'@'10.10.10.3';
This gave the root user privileges to manipulate the database, but
**not** to pass on their privileges to others. When I re-granted using
this command:
GRANT ALL PRIVILEGES ON rt4.* TO 'root'@'10.10.10.3' WITH GRANT OPTION;
...the "Access denied" error vanished. I also had to readjust my
RT_SiteConfig.pm back to using root as the db admin. Solved and archived
for posterity. Thanks!
On 10 December 2014 at 01:56, Kristan Wagner
<kristan.wag...@lifewireless.com
<mailto:kristan.wag...@lifewireless.com>> wrote:
I am having troubles with the database initialization, for a fresh
install of RT 4.2.9. The error message is: DBD::mysql::st execute
failed: Access denied for user 'root'@'10.10.10.3' to database
'rt4' at /tmp/rt-4.2.9/sbin/../lib/RT/Handle.pm line 452. make:
*** [initialize-database] Error 255
Here's my setup: Separate servers for the web frontend and the
database, both running Ubuntu 14.04. The web frontend is running
Apache/2.4.7 and has an IP address 10.10.10.3. The database
machine is running MySQL 5.5.40 and has the IP address
10.20.20.5. Both of these are fresh installs, and RT is a fresh
install, but we plan to migrate our old RT database (3.6.5) when
the 4.2.9 is (eventually) running and tested. Right now, I'm just
trying to get 4.2.9 going.
Here's the context for the error: I've been following the README
on the bestpractical website. At step 2, I ran configure with only
one flag, --with-db-host=10.20.20.5. At step 4, fixdeps kept
claiming that MySQL was missing, so I had to install MySQL on the
web frontend as well, just to get it to install. At step 6a, make
initialize-database is failing with the following output:
root@10.10.10.3/tmp/rt-4.2.9#
<http://root@10.10.10.3/tmp/rt-4.2.9#> make initialize-database
/usr/bin/perl -I/opt/rt4/local/lib -I/opt/rt4/lib
sbin/rt-setup-database --action init --prompt-for-dba-password
In order to create or update your RT database, this script needs
to connect to your mysql instance on 10.20.20.5 (port '3306') as root
Please specify that user's database password below. If the user
has no database password, just press return.
Password:
Working with:
Type: mysql
Host: 10.20.20.5
Port: 3306
Name: rt4
User: rtuser
DBA: root
Now creating a mysql database rt4 for RT.
Done.
Now populating database schema.
Done.
Now inserting database ACLs.
[23346] [Mon Dec 8 21:27:35 2014] [warning]: DBD::mysql::st
execute failed: Access denied for user 'root'@'10.10.10.3' to
database 'rt4' at /tmp/rt-4.2.9/sbin/../lib/RT/Handle.pm line 452.
(/tmp/rt-4.2.9/sbin/../lib/RT/Handle.pm:452)
[23346] [Mon Dec 8 21:27:35 2014] [critical]: DBD::mysql::st
execute failed: Access denied for user 'root'@'10.10.10.3' to
database 'rt4' at /tmp/rt-4.2.9/sbin/../lib/RT/Handle.pm line 452.
(/tmp/rt-4.2.9/sbin/../lib/RT.pm:388)
DBD::mysql::st execute failed: Access denied for user
'root'@'10.10.10.3' to database 'rt4' at
/tmp/rt-4.2.9/sbin/../lib/RT/Handle.pm line 452.
make: *** [initialize-database] Error 255
I've spent a lot of time reading forum questions about
mysqld.sock, but please note that there is NO mention of any
socket trouble in the error, so I don't think that's it. Plus,
it's able to get through the first two steps just fine.
Here is some of RT_SiteConfig.pm from the web frontend:
Set($DatabaseHost, '10.20.20.5' );
Set($DatabasePort, "3306");
Set($DatabasePassword, q{passwordhere});
Set($DatabaseUser, "rtuser");
Set($DatabaseName, q{rt4});
On the database server, here is some of my.cnf:
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
bind-address = 0.0.0.0
I've already tried this using the option skip-name-resolve, but
that did not help.
Here are the permissions for the root user, as shown on
10.20.20.5's MySQL instance:
+------------------------------------------------------------------------------------------------------------------------+
| Grants for root@10.10.10.3 <mailto:root@10.10.10.3>
+------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.10.10.3' IDENTIFIED BY
PASSWORD '*hash'
| GRANT ALL PRIVILEGES ON `rt4`.* TO 'root'@'10.10.10.3'
+------------------------------------------------------------------------------------------------------------------------+
I've even tried creating a general root user for 'root'@'%' but
the same error is thrown. Any help is appreciated. Thanks.