if you have mysql installed locally, you can use that to connect to the remote host and achieve the desired result
from a command line:
c:\>mysql -h<host> -u<user> -p -e"Select statement" database [table optionally] > c:\tmp\myfile.csv
the password will be requested before the query will...
When using @ variables they are set using
@variable:=value
Note the colon, everything should work ;)
mysql> select @this:=curdate();
+------------------+
| @this:=curdate() |
+------------------+
| 2013-02-15 |
+------------------+
1 row in set (0.00 sec)
mysql> select @this...
Yes, sorry, I used IP addresses I had in stock, check the numbers :) -- you should change 101 in my query for 100 as in yours.
______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
Would it be more prudent to use a stored procedure to do an "after insert" update for the location of the call?
This will save you doing an additional lookup back to your app, and just leaves the database to do its thing on simple inserts...
Can you use a view instead, create it as a select statement with a rolling date?
eg :
create view V_TRANSACTION_TYPES as select distinct transaction_type from table where yourdate >= date_sub(curdate(), interval 30 day);
______________________________________________________________________...
select d07 from service where if(instr(d07,' ') > 0, left(d07,instr(d07,' ')),d07) = '10.101.1.1' ;
______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
I Totally agree with Ian, don't use spaces in table names, you will find a world of pain in the future with coding/using tables with spaces in the names.
______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
Not sure I'm totally on the same page, but mutt likes to sit and wait for input for the message body.
I normally avoid that by reding body contents from dev/null when just sending attachmets:
mutt -s"subject line" -a attachment recipient@somewhere.com </dev/null
Cheers
K...
This is one of 2 other settings you have to consider.
1)apache (guessing you're using this) this has a LimitRequestBody [size in bytes] which can affect what you can upload, this option can be removed.
2) php.ini change teh value set by upload_max_filesize...
Just out of curiosity, what do your tables indexes show, I had a table recently where the indexes were showing as "NULL" and a quick anaylze table <tablename> fixed these and corrected my speed issue.
Alternatively I guess you could set up a char_length field and populate it from a trigger on...
A table with 1.77 million records returns all results in a maximum of 0.02 seconds, the field is non indexed.
The server is quad core xeon with 8gb of ram all laid over to mysql.
______________________________________________________________________
There's no present like the time, they...
no temp table required, use localised variables. haven't had a huge chance to look, they do somthing odd on the second execution but look ok on the first:
SELECT * FROM `test` where `main`='sales'
union select ' ','Total Sales',@s1:=sum(month1) as s1,@s2:=sum(month2) as s2,' ' from...
you will need to use an account which has been set up on the remote server, and that account should have its "host" value set to either:
a) xxx.xxx.xxx.xxx //the IP you are connecting from
b) '%' // any address.
This account will need appropriate priviliges for select, insert, update etc.
A...
If you have a linux box, I'd have a look at AWK to format this into a suitable insert statement, rather than trying to do anything in the database.
______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
do you have mutt installed,
mutt -s "subject line" -a /path/to/filename someone@somewhere.com </dev/null
This will send the report for you.
______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
much simplified to start you off then ,
mysql> delimiter //
mysql> CREATE PROCEDURE procedure1(IN param1 INTEGER)
-> LANGUAGE SQL
-> NOT DETERMINISTIC
-> BEGIN
-> select
-> IF(param1="17",'birds','beasts');
-> END;
-> //
Query OK, 0 rows affected (0.00 sec)...
I'd drop all the comments and see if you get further, also you may need to change teh delimiters as you load stored procs.
heres a sample.
DELIMITER //
CREATE PROCEDURE do_thing(Field_ID varchar(15))
LANGUAGE SQL
NOT DETERMINISTIC
COMMENT 'Undo Exported date and time'
BEGIN...
Once you find and can access mysql,
mysql> create database newdb;
mysql> \. /path/to/file.sql
mysql should start reading the file and loading it, provided the create info is also in the file.
______________________________________________________________________
There's no present like the...
Oh, I was expecting something more than just a variable, more like a whole report.
______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.