r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[MySQL]

Janko
7-Jun-2009
[1167]
load "[... ]"
amacleod
7-Jun-2009
[1168x4]
right...duh!
From what I have been able to read about timestamps and mysql I might 
as well insert the client's time...
But then I would need to issure clietn's clocks are correct....
What is SOP for this situation?
insure
Quick question about computer time,,,
Eastern Time is GMT-5 which my computer clock is set to...
why does rebol give me time with -4:00?
7-Jun-2009/20:24:01-4:00
Graham
7-Jun-2009
[1172]
daylight saving?
amacleod
7-Jun-2009
[1173x5]
ok, but what is rebol reading to get the time?
I just did an update to my server time and my other computer..

I used time.nist.gove for the server and time.windows.com for the 
other computer and they were two minutes apart
I tried again and they are now synced...atleast to the minute...
Rebol must get the zone from the computer but why is it different?
I know..a little off topic..moving to core
amacleod
4-Jul-2009
[1178x2]
Any reason why my data in a 'text' column is getting truncated at 
9999 characters? I tried 'longtext' but there was no change..

I thought 'text' holds up to 4 gigs from what I read...


I saw something about longtext being limited by the way a client 
handles packets..could this be a problem with MySQL protocol?
I tried to insert a longer string using phpMyAdmin and it inserted 
fine...no truncation.
I guess its mysqlprotocol.r problem.

Anyone else encounter this? Any work arounds?
Graham
4-Jul-2009
[1180x2]
can you use any other formats?  Does mysql have text blobs ?
try wireshark to do a tcp trace to make sure all the packets are 
getting thru
Will
5-Jul-2009
[1182x2]
I have no problem inserting much bigger data to text fields using 
Dock's driver, thought I can't suggest anything else then wiresharking 
for debugging
Maarten: is there any news about your Sphinx stuff? Reichart "promised" 
to release it soon, that was some time ago 8)
Graham
5-Jul-2009
[1184]
Will did you not try the mysql driver for sphinx??
Dockimbel
5-Jul-2009
[1185]
Amacleod: There's no internal limit at 10000 bytes in mysql driver 
(single packet default limit is 1MB). Are you using prepared statements? 
If not, are you sure that your data is correctly encoded? Anyway, 
try using TRACE mode : trace/net on. Look at the sent packets size 
to see if there's a truncation in the mysql driver.
amacleod
5-Jul-2009
[1186x2]
I check it out thanks, Doc.
I'm sending much larger blobs (image files) and it works just text 
is giving the problem but I'll need to look further. Thanks all.
Will
5-Jul-2009
[1188x5]
are you using latest 1.3beta versionof the driver? previus version 
may have a problem and truncate..
Graham: no, do you? how is your experience with it?
IIRC previous version had a problem with escaping correctly {'} in 
some circumstances, that may be a cause of truncation.
here is the latest http://softinnov.org/tmp/mysql-protocol-41.rgive 
it a try
from the changelog, " Fixed parsing bug with \\. Now expression like 
"'\\', 'wo;rd'" will be parsed correctly."
Graham
5-Jul-2009
[1193x3]
I don't use mysql .. but Firebird.  And I'm waiting for the sphinx 
integration into firebird before I try doc's mysql driver.
to communicate with sphinx.
As for waiting for Qtask to decide on their licensing ... well, enuff 
said.
Will
27-Sep-2009
[1196]
Understanding and control of MySQL query optimizer http://assets.en.oreilly.com/1/event/21/Understandingand Control of MySQL Query Optimizer_ Traditional and Novel Tools and Techniques Presentation.pdf
Robert
4-Mar-2010
[1197]
Has anyone tried to get Doc's mysql stuff to run with R3 yet?


@Doc: Do you think it can be ported/adapted to work with R3 without 
to much effort?
Dockimbel
4-Mar-2010
[1198x2]
At least, the whole networking support needs probably to be fully 
rewritten for R3. Beyond that I'm not sure what you work or not out 
of the box with R3. String encoding and Unicode might require some 
additional code. MD5 support is also required btw, if you want to 
use passwords with 4.1+ MySQL servers (for 3.x support, you would 
need to rewrite the whole current driver encryption code).
what you work => what would work
amacleod
24-May-2010
[1200]
I signed up with a web provider but they do not seem to allow remote 
direct access to the mysql db unless you specify the ip that first...which 
is no good if you have an app used by many people in any number of 
locations....


Is this standard procedure? I had the same problem with another provider.

What is the way around this? CGI?
Graham
24-May-2010
[1201x2]
Eh??
A web provider only provides access to mysql from a script ... and 
you will have a static ip for your web host.
TomBon
24-May-2010
[1203x2]
amacleod, CGI, yes or use rebservice if you allowed to start a port 
and forward the sql request to doc's mysql sheme as localhost 

or switch to a virtual server with linode or slicehost for full control.
amacleod, CGI, yes or use rebservice if you allowed to start a port 
and forward the sql request to doc's mysql sheme as localhost 

or switch to a virtual server with linode or slicehost for full control.
amacleod
24-May-2010
[1205x4]
I'm serving the db from my own p for this host as there is server 
for now as bandwidth is not an issue yet. I signed unlimited bandwidth, 
storage, email accounts, mysql db's etc. for a few bucks a month. 

I was just testing mysql for possible use down the road.


When the time comes i will probably go the "linode" route as iwould 
want to use Cheyenne too and no provider is going to let you run 
that.
that makes no sense!!! I wrote all over my own message
I'm using my own server for now until bandwidth becomes an issue.
I think I will need to convert my app over to a cgi based access 
for mysql as I may want to access them from non-rebol based clients 
(smart phones).


Does anyone know what is the standard method for say iphones to access 
data from servers? CGI? or is there other prefered method?
Henrik
25-May-2010
[1209]
I usually build a server script to access the database via procedures 
needed for the app. They then communicate via JSON. Works pretty 
well and eliminates the need for client side SQL, and it works with 
anything that can POST to a webserver.
caelum
24-Aug-2010
[1210]
Hi MySQL Group, I program in C, Fortran, Cobol, Superbase4, PHP, 
MySQL and some other languages but I'm fairly new to Rebol. I am 
attempting to connect to a remote MySQL database by following the 
intstructions here http://reboltutorial.com/blog/mysql/.I have downloaded 
the mysql-protocol.r file and run it in my Rebol program but I keep 
getting this error 'Access Error: Network timeout'. What does that 
mean? How do I fix it? Any help appreciated.
amacleod
24-Aug-2010
[1211x2]
Sounds like you are not connecting to the server...try pinging it 
first. Check the port.

Shows us the code you aer using.
Is the Mysal server on your local machine? or on a hosted machine? 
Sometimes the host company will not allow you to directly acess the 
server from remote locations. You would need to access it via CGI.
caelum
24-Aug-2010
[1213]
I pinged the server just fine. Here is the code:

REBOL []
#include do %mysql-protocol.r

results: read rejoin [mysql://mysqluser:[mypassword-:-mysite-:-com]:22/mydatabase 
["SELECT * FROM tablename"]


The MySQL server is on a hosted machine. In cpanel I added my IP 
address to the 'Remote MySQL' Remote Database Access Hosts list. 
I think you are right that I will need to access the database from 
the cgi because the hosting company will not allow direct access, 
even though its suppossedly allowed in cpanel.

Thanks for your help.


Are there any examples of accessing a MySQL database via CGI in Rebol? 
I just googled and found nothing.
amacleod
24-Aug-2010
[1214x2]
Here is a simple example but basically you just create a script that 
reads from the DB locally and prints. Your remote app reads the printout 
when it reads from the page:

#!/user/cgi-bin/REBOL -cs
REBOL [Title: "Get Roster"]

do %mysql-protocol.r

db_ip: mysql://user:[password-:-localhost]:3306/bighouse

db: open db_ip
insert db "SELECT * FROM roster"
		dat: copy db
close db

print dat
Place this file in your cgi-bin and have your remote client 'read' 
the url to that file.  


Don't forget to place mysql-protocol.r somewhere on the server an 
'do' it.


you could 'encript' the output with encloak using a simple key if 
some security of the data is needed. Just decloak at the remote client 
with same key.
ChristianE
25-Aug-2010
[1216]
Have you checked whether MySQL is configured properly to accept tcp-requests 
instead of only socket-based connections?