remote mysql problem (important)

katmai

Well-Known Member
Mar 13, 2006
564
3
168
Brno, Czech Republic
i have a big problem on my end.

i have 2 servers as i want to use as web front end, 1 site, 1 db. and 1 db server.

i setup the first server to use remote mysql. now. when i setup the second server to use remote mysql, doesn't work. i mean the server is still set as localhost. any ideas?
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
77
308
cPanel Access Level
Root Administrator
So, you have a total of three servers? 2 for the web, 1 for the db? Did you use the Remote MySQL setup "wizard" in WHM to setup both?
 

katmai

Well-Known Member
Mar 13, 2006
564
3
168
Brno, Czech Republic
yes. but on the second server it doesn't set it up.

mysql root user from the second server has all privileges on the db server,
 

katmai

Well-Known Member
Mar 13, 2006
564
3
168
Brno, Czech Republic
Current MySQL Server
localhost


... and i just run the setup mysql server script now. is there any log i could check on what's going wrong?
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
77
308
cPanel Access Level
Root Administrator
Always check /usr/local/cpanel/logs/error_log

Which versions of cPanel are you using?
 

katmai

Well-Known Member
Mar 13, 2006
564
3
168
Brno, Czech Republic
latest current. error_log does not show anything yet.
 

katmai

Well-Known Member
Mar 13, 2006
564
3
168
Brno, Czech Republic
okay i got it now. seems that i forgot to configure the firewall to allow outgoing to that ssh ip :) check check the firewall otherwise you end up banging your head over the wall :)
 

katmai

Well-Known Member
Mar 13, 2006
564
3
168
Brno, Czech Republic
Wed Sep 19 15:50:21 2007 warn [mysqlfe::listdbs]: Encountered error in mysqlfe::listdbs: Error from mysql wrapper: at /usr/local/cpanel/Cpanel/Logger.pm line 35
Cpanel::Logger::cplog('Encountered error in mysqlfe::listdbs: Error from mysql wrapper:...', 'warn', 'mysqlfe::listdbs', 1) called at /usr/local/cpanel/Cpanel/EventHandler.pm line 43
Cpanel::EventHandler::event(2, 'post', 'mysqlfe', 'listdbs', 'HASH(0x90edd54)', 'ARRAY(0x9700844)') called at cpanel.pl line 4600
main::api2_exec('MysqlFE', 'listdbs', 'HASH(0x970a078)', 'HASH(0x90f1b1c)') called at cpanel.pl line 1238
main::cpexectag('<?cp MysqlFE::listdbs(^J[tr class="row-%"]^J^I[td align="center"]%[...') called at cpanel.pl line 4392
main::dotag(undef) called at cpanel.pl line 4281
main::cpanel_parseblock('SCALAR(0x90a9b40)') called at cpanel.pl line 4235
main::cpanel_parse('GLOB(0x92f13e4)') called at cpanel.pl line 1077


second server - error log.

when i create databases on the second server they are not being set on the remote server...

do i have to flush privileges or restart the mysql server or some sort?
 
Last edited:

katmai

Well-Known Member
Mar 13, 2006
564
3
168
Brno, Czech Republic
this is crazy. i just added an user to the second server, to see maybe it's privileges issue, and the remote mysql server is gone now, when i check whm. it's again localhost, and the dbs are on localhost.

help?

Using Remote mySQL Server
Copying MySQL Script.....0%.. ..100%.. ...Done
Running MySQL Script...

Using 1.1.1.1 as the access ip
Sync Source: http://httpupdate.cpanel.net/CURRENT/scripts
Fetching http://httpupdate.cpanel.net/cpanelsync/CURRENT/scripts/.cpanelsync.lock (0)[email protected]
Fetching http://httpupdate.cpanel.net/cpanelsync/CURRENT/scripts/.cpanelsync.bz2 (0)[email protected]%...48%...73%...97%...100%......Done
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-services.us IDENTIFIED BY 'Lv_duvmQ' WITH GRANT OPTION' at line 1
Waiting for mysql to restart..............finished.

root 7419 0.0 0.0 2412 1096 ? S 16:04 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/domain.com.pid
mysql 7458 0.0 0.3 74692 6668 ? Sl 16:04 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/domain.com.pid --skip-external-locking --socket=/var/lib/mysql/mysql.sock

mysql started ok

Done
 
Last edited:

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
77
308
cPanel Access Level
Root Administrator
Looks like you have a - in your hostname. This is a known issue with the Remote Setup wizard. Note, I'm only guessing that because of this particular message:

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-services.us IDENTIFIED BY 'Lv_duvmQ' WITH GRANT OPTION' at line 1
This means the GRANT statement is failing, you'll need to log into the remote server and execute it manually.

Code:
GRANT ALL PRIVILEGES ON *.* to [email protected] IDENTIFIED BY 'Lv_duvmQ' WITH GRANT OPTION;
/code]

Replace server2 with the actual hostname.
 

katmai

Well-Known Member
Mar 13, 2006
564
3
168
Brno, Czech Republic
the /root/.my.cnf password was not updated. i updated it with the db server root pass, and everything works now. eximstats too :)