Open HamburgerJungeJr opened 8 years ago
Can you please put your connection detail like settings.json and the code that is using it?
Thanks. Is this the code you mean?
Meteor.startup(function(){
// Connection zur MySQL-DB
var database = new LiveMysql({
host: 'localhost',
port: "3306",
user: 'root',
password: 'myrootpassword',
database: 'ackellinghusen'
});
// News publisher
Meteor.publish('news', function () {
return database.select("SELECT * FROM tx_news_domain_model_news WHERE deleted=0 AND pid=96 ORDER BY datetime DESC", [{table: "tx_news_domain_model_news"}]);
});
// News-tag publisher
Meteor.publish('newsTags', function () {
return database.select("SELECT mm.*, tag.* FROM tx_news_domain_model_news_tag_mm as mm JOIN tx_news_domain_model_tag as tag on mm.uid_foreign=tag.uid", [{table: "tx_news_domain_model_news_tag_mm"}, {table: "tx_news_domain_model_tag"}]);
});
// News-tag publisher
Meteor.publish('newsImages', function () {
return database.select("SELECT file.identifier AS path, ref.uid_foreign AS newsId, ref.sorting_foreign AS sorting, ref.showinpreview AS isPreview FROM sys_file AS file JOIN sys_file_reference AS ref ON file.uid=ref.uid_local WHERE ref.pid=96;", [{table: "sys_file"}, {table: "sys_file_reference"}]);
});
// Termine publisher
Meteor.publish('termine', function () {
return database.select("SELECT uid, unix_timestamp(start_date) AS start_date, unix_timestamp(sec_to_time(start_time)) as start_time, title FROM tx_cal_event WHERE calendar_id=1 AND date(start_date) >= Date(now()) AND deleted=0 ORDER BY start_date ASC;", [{table:"tx_cal_event"}]);
});
//TerminDetail publisher
Meteor.publish('termineDetail', function () {
return database.select("SELECT event.uid, unix_timestamp(event.start_date) as start_date, unix_timestamp(event.end_date) as end_date, event.allday, unix_timestamp(sec_to_time(event.start_time)) as start_time, unix_timestamp(sec_to_time(event.end_time)) as end_time,event.title, event.description, organizer.name AS organizerName, location.name AS locationName, location.street AS locationStreet, location.zip as locationZip, location.city AS locationCity, location.latitude AS locationLatitude, location.longitude AS locationLongitude FROM tx_cal_event AS event LEFT JOIN tx_cal_organizer AS organizer ON event.organizer_id=organizer.uid LEFT JOIN tx_cal_location AS location ON event.location_id=location.uid;", [{table: "tx_cal_event"},{table: "tx_cal_organizer"},{table: "tx_cal_location"}]);
});
});
I forgot to mention, that evrything works on my dev-machine. With port and with socket.
What's your mysql version on production & dev? Is the bin log enabled on prod same way as dev ?
As per my past experience it could be due to mysql version.
Dev
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
log-bin=mysql-bin
expire_logs_days = 2
server-id = 1
binlog_format = row
Prod
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
# binlog config
[mysqld]
log-bin=mysql-bin
expire_logs_days = 2
server-id = 1
binlog_format = row
#bind-address = 0.0.0.0
Please try the below amendments and let me know if still experiencing the same error: Application: var database = new LiveMysql({ host: 'localhost', port: "3306", user: 'root', password: 'myrootpassword', database: 'ackellinghusen', "serverId": 1, "minInterval": 200 });
my.cnf: log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 2 server_id = 1 binlog_format = row binlog_do_db = ackellinghusen max_binlog_size = 100M
Now restart your mysql server and you will be good with your binlog enabling. Thne restart meteor application server and you should be good.
Thanks, but nothing changed
I've got the problem.
Everything works when I change localhost to the IP of my Server. But where does this come from??
@HamburgerJungeJr Did you use mupx
to deploy or something else? My rather simple app is working on dev, but when I use mupx
deploy, I am getting a ECONNREFUSED error
Hi,
i try to connect to a mysql database on an ubuntu server. I've deployed my application with meteor-up. The application is running but i cannot conenct to my mysql database.
If I use host/port I got the Error
If I connect with socket I got the error
Where is the problem?? Thanks for help.