Forum Replies Created
-
AuthorPosts
-
peterlaursenParticipant
You are right:
http://dev.mysql.com/doc/mysql/en/batch-mode.html
MySQL command line client implements some functionality/commands that are not SQL commands themselves. Maybe the “source” command should be implemented in SQLyog editor? I am not sure.
If you are running MySQL 5 you can put the batch script in a stored procedure and CALL it(). That is the “standard” way to do it.
peterlaursenParticipantI am afraid you must explain a little bit more!
I just tested with MySQL 5.0.13 (on windows) and SQLyog 4.2 beta 2 and import from MS-Access. The empty defaults like
in the XML does not prevent correct functioning here. However undoubtedly you came across som information that solved your problem.
Could you point to those resources more precisely?
Is it a 5.0.13 only problem, a Mac OS-X only problem or what ?
Does it take a specific server configuration to reproduce?
What is your ODBC-source ?
Also a small XML-file that does not work with
on your system and does work without them would be useful. You will need to give information so that problem can be reproduced! Also why not link to the resources that you googled? We don't read thought. Though it sometimes would be practical! 😉
peterlaursenParticipantThe MySQL user management has all you need! For instance create a user with SELECT, INSERT and UPDATE privilege to a specific database and use that user for connection.
You should not give user credentials for a user that has DROP-privilege to “every dork” 😀
Your problem is database management. It is YOUR problem. Not af problem of webyog!
peterlaursenParticipantand BTW. If logfile is written to same directory as the SJA executable you simply don't need to specify any path at all.
I created a webroot/test directory and put SJA and the php- and xml-file there.
Php code looks still like my first example and this
http://deepeter.dyndns.dk/test/test.php
writes the peter.log to webroot/test .
I suggest you try this to be 100% sure that it is not a problem with php parsing/resolving the path. If it still don't work it must be a server/php configuration issue.
My best guess is that
CODEsja /home/httpd/vhosts/domain.com/httpdocs/_configurations/database_sync.xml -l/home/httpd/vhosts/domain.com/_configurations/sja.logdoes not work, because being a webserver plugin php has its root in /httpdocs .
maybe
CODEsja /_configurations/database_sync.xml -l/_configurations/sja.logwould work as an absolute adressing. I guess so actually (just checked with a website with the same vhost's structure that I can access with ftp. But no chance for me to execute code there. I would be quite unpopular if something went wrong!)
peterlaursenParticipantQuote:can I bundle the same APIs with my applicationYes you can. The C API is included with the source distribution of the MySQL server.
About licensing read for instance:
http://www.mysql.com/news-and-events/newsl…0000000220.html. The GNU public license is not “without any restrictions”. But no restriction that prevents you to use it!
Quote:what options do I have to connect to the database from my application code.The API sends hostname, username, password, port (and database(s) if you choose). That is what you need to connect. The rest is server configuration. However if you need tunnelling you will need specific code for that.
The complet set of connectors and the MySQL source can be found here: http://dev.mysql.com/downloads/
peterlaursenParticipantQUOTEI'm actually executing TAR and FTPSYNC programs from the same directory and it works just fine… But it doesn't work with PHP.yes but the php-configuration of course has no effect on code that is not php!
peterlaursenParticipantOne thing more: Where is the SJA executable located relative to where the php, xml and log files are?
I had some problems with writing log somewhere not in the tree below SJA using absolute adressing.
But succeded with relative adressing like
CODEexec('sja test.xml -l..logpeter.log');SJA executable, test.php and test.xml is in webroot/test
I write log to webroot/log
.. is like HTML: means one folder up in tree.
And …… means three folder up in tree.
On Linux you proably must use / not .
peterlaursenParticipantphp configuration:
I checked my own php-ini (in the moment 5.1 RC, but I guess this is the same with all versions). This setting looks interesting:
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
;open_basedir =
Maybe you should check that! Or let the Sys Admin do so.
peterlaursenParticipantI can see that I had a visit. You probably!
QUOTESync started at Fri Sep 30 02:30:34 2005I shall not say more! A php/vhost configuration issue?
I know nothing about it.
But nice if someone with a local *nix would try to repeat the simple exercise SJA for Linux that I did with SJA for Windows.
Undoubtedly Ritesh or sombody else at Webyog will look into it tomorrow. Or later today actually. It is 6 am in Bangalore! Get up guys! There is work for you! 😀
peterlaursenParticipantQUOTEexec('sja '.DOMAIN_CONFIGURATIONS_PATH.'database_sync.xml -l'.DOMAIN_CONFIGURATIONS_PATH.'sja.log');Since you use the default log file name you could try too to omit the -l -parameter
QUOTEexec('sja '.DOMAIN_CONFIGURATIONS_PATH.'database_sync.xml';is it correct php syntax that the
QUOTE.DOMAIN_CONFIGURATIONS_PATHmust start with a punctuation? I just ask 😉
This works with windows SJA on my own php installation:
CODESync succesfull“;
?>
to simplify things I copied sja.exe to the webroot of my local Apache with the test.php and test.xml-files. Data are sync'ed and the peter.log is created.
You are welcome to try here:
http://deepeter.dyndns.dk/test.php
.. you wont see the data .. but I can paste in the log!
I believe you simply should write correct syntax so that the system can resolve the path. I apologize if I am wrong – I dont have a *nix at the moment 😮
peterlaursenParticipantQUOTE“Error opening session ERROR log file. ” is the error I get when use PHP to exec('sja') the SJA file.Yes but if there are two many .(punctuations) and a ” (double-quote) missing the generated string may not be valid!
peterlaursenParticipantQUOTEexec($SJAPATH.”sja “.$JOBNAME.” -l”.$SJALOGPATH.$JOBNAME.”.log >> $SJALOGPATH.$JOBNAME.”.out”);I am not a coder but are all those punctuations correct? And is there not a ” missing after “log” ? I would propose:
QUOTEexec($SJAPATH.”sja “$JOBNAME” -l”$SJALOGPATH.$JOBNAME”.log” >> $SJALOGPATH.$JOBNAME.”out”);And why dublicate the log-file to an out-file. Just
QUOTEexec($SJAPATH.”sja “$JOBNAME” -l”$SJALOGPATH.$JOBNAME”.log”);Apologize for my interference in this. But I take a chance to learn something too!
There are bugs in version 1 so if there is a problem with version 2 it should be fixed.
peterlaursenParticipantMaybe this one weill help here:
peterlaursenParticipantQuote:but sometimes never finishYou must understand the the client (the computer running the sync job) must do a lot of calculations (calculations of checksums). That can take a lot of time is there are many BIG field (BLObs etc) and many rows. Also database servers at ISP often are very slow at the type of queries that the sync job needs.
The solution is to use the
and options effectively so that no time is wasted doing a lot of calculations that there is no need to do. I persoanlly have an example where the time for a sync job was reduced from 11 hours to 5 minutes using these options.
You can try if you can read this paper:
http://www.webyog.com/forums/index.php?showtopic=1507
I have a newer version that I can mail you, if you PM me your mail adress.
peterlaursenParticipantOne thing more:
Quote:I am trying to connect up to the local mysql server via the SSH tunnel.You shall NOT use any other SSH client software for SSH-tunnelling then what comes with SQLyog! (that is the file plink.exe in SQLyog installation directory).
I am not sure about what you mean exactly but I get the impression that you try to tunnel SQLyog through a SSH-tunnel created with another application.
-
AuthorPosts