Possible to copy the key field to another on INSERT?

2012-10-16 Thread W. D.
When creating a record, the first field (KeyField)... KeyFieldBIGINT UNSIGNED NOT NULL AUTO_INCREMENT ...is it possible to copy this auto-generated value into another field when using the same INSERT that creates the record? Or would I have to use an UPDATE query using LAST_INSERT_ID()

Re: error 13

2012-10-16 Thread Lixun Peng
Hi, you can switch to mysql user "su - mysql", and then stat this file. if you can't access, mysql user have not permissions. On Wed, Oct 17, 2012 at 11:49 AM, kalin wrote: > > > > On 10/16/12 10:49 PM, Michael Dykman wrote: > >> is your mysql client on the same host as the mysql server? if not

Re: error 13

2012-10-16 Thread kalin
On 10/16/12 10:49 PM, Michael Dykman wrote: is your mysql client on the same host as the mysql server? if not, google the docs for 'local infile' yes. my laptop. On 2012-10-16 10:45 PM, "Lixun Peng" wrote: Hi, What's the dir permissions? For example, if we have a file in /a/b/file,

Re: error 13

2012-10-16 Thread kalin
On 10/16/12 10:44 PM, Lixun Peng wrote: Hi, What's the dir permissions? was 755. now 777. same result. For example, if we have a file in /a/b/file, dir a is 644, even though file is 777, we can't access file, too. On Wed, Oct 17, 2012 at 10:31 AM, kalin mailto:ka...@el.net>> wrote:

Re: Error message I am getting today. All help appreciated.

2012-10-16 Thread Dehua Yang
Hi There many reasons to lose connection to MySQL server. And what's more , the important thing is that you should provide the error code to us. If you got the error code , you can check it by perror X Anymore detail information would be appreciate ! On Wed, Oct 17, 2012 at 10:32 AM, ad...@cana

Re: error 13

2012-10-16 Thread Michael Dykman
is your mysql client on the same host as the mysql server? if not, google the docs for 'local infile' On 2012-10-16 10:45 PM, "Lixun Peng" wrote: Hi, What's the dir permissions? For example, if we have a file in /a/b/file, dir a is 644, even though file is 777, we can't access file, too. On

Re: Error message I am getting today. All help appreciated.

2012-10-16 Thread Lixun Peng
Hi, What query is running? Is web server and DB server in the same server? Have something in error.log of MySQL? On Wed, Oct 17, 2012 at 10:32 AM, ad...@canadianinvestors.com < ad...@canadianinvestors.com> wrote: > Hi, > > I run www.canadianinvestors.com and am getting this error message. > > Wa

Re: error 13

2012-10-16 Thread Lixun Peng
Hi, What's the dir permissions? For example, if we have a file in /a/b/file, dir a is 644, even though file is 777, we can't access file, too. On Wed, Oct 17, 2012 at 10:31 AM, kalin wrote: > > > hi all.. > > this hasn't happened before... > > i'm in as root on the command line cleint. trying

Error message I am getting today. All help appreciated.

2012-10-16 Thread ad...@canadianinvestors.com
Hi, I run www.canadianinvestors.com and am getting this error message. Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in /var/www/domains/x.canadianinvestors.com/docs/common/library/db_connect.inc on line 15 Lost connection to MySQL server during

error 13

2012-10-16 Thread kalin
hi all.. this hasn't happened before... i'm in as root on the command line cleint. trying to load data infile '/path/to/file' file is owned by mysql and it has 777 permissions. the directory where the file is is also owned by mysql. when i do: mysql> load data infile '/path/to/file' etc.

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread spameden
That's exactly what I thought when reading Michael's email, but tried anyways, thanks for clarification :) 2012/10/16 > 2012/10/16 12:57 -0400, Michael Dykman > your now() statement is getting executed for every row on the select. try > ptting the phrase up front > as in: > set @ut= u

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread hsv
2012/10/16 12:57 -0400, Michael Dykman your now() statement is getting executed for every row on the select. try ptting the phrase up front as in: set @ut= unix_timestamp(now()) and then use that in your statement. Quote: Functions that return the current date or time each are

Re: Odd Behavior During Replication Start-Up

2012-10-16 Thread Shawn Green
On 10/16/2012 4:02 PM, spameden wrote: 2012/10/16 Tim Gustafson Thanks for all the responses; I'll respond to each of them in turn below: you can not simply copy a single database in this state innodb is much more complex like myisam I know; that's why I rsync'd the entire /var/db/mysql fo

Re: Odd Behavior During Replication Start-Up

2012-10-16 Thread Reindl Harald
Am 16.10.2012 21:55, schrieb Michael Dykman: > I'm confused: in the first sentence, you say snapshots are bad (which > directly contradicts the official MySQL documentation), and in the > second sentence you say rsync is good. Why would an rsync of a file > system snapshot not be good enough? B

RE: Can I measure the use of index?

2012-10-16 Thread Rick James
Caution -- this includes only the indexes you have actually used since turning on the stats. > -Original Message- > From: Eric Bergen [mailto:eric.ber...@gmail.com] > Sent: Monday, October 15, 2012 8:55 PM > To: Lixun Peng > Cc: Perrin Harkins; Carlos Eduardo Caldi; mysql@lists.mysql.com

Re: Odd Behavior During Replication Start-Up

2012-10-16 Thread spameden
Also, forgot to say you need to shutdown completely MySQL before rsync'ing it's data, otherwise your snapshot might be inconsistent thus InnoDB fail. Also make sure database shutdown was correct in the log. 2012/10/16 Tim Gustafson > > load data from master never worked for innodb. > > And the

Re: Odd Behavior During Replication Start-Up

2012-10-16 Thread spameden
2012/10/16 Tim Gustafson > Thanks for all the responses; I'll respond to each of them in turn below: > > > you can not simply copy a single database in this state > > innodb is much more complex like myisam > > I know; that's why I rsync'd the entire /var/db/mysql folder (which > includes the ib_

Re: Odd Behavior During Replication Start-Up

2012-10-16 Thread Tim Gustafson
> load data from master never worked for innodb. And the suggested mysqldump command does not work for MyISAM. Either way, the suggestion is a non-starter. I could "flush tables with read lock" and then do a mysqldump but again that would take hours and all the databases would be read-only durin

Re: Odd Behavior During Replication Start-Up

2012-10-16 Thread Michael Dykman
load data from master never worked for innodb. On 2012-10-16 3:52 PM, "Tim Gustafson" wrote: Thanks for all the responses; I'll respond to each of them in turn below: > you can not simply copy a single database in this state > innodb is much more complex like myisam... I know; that's why I rsy

Re: Odd Behavior During Replication Start-Up

2012-10-16 Thread Tim Gustafson
Thanks for all the responses; I'll respond to each of them in turn below: > you can not simply copy a single database in this state > innodb is much more complex like myisam I know; that's why I rsync'd the entire /var/db/mysql folder (which includes the ib_logfile and ibdata files, as well as al

Re: Odd Behavior During Replication Start-Up

2012-10-16 Thread Michael Dykman
I have to agree with Harald on this: filesystem snapshots are not an effective way to clone innodb databases. The rsync-based method described has worked for me in large scale data situations very reliably. - michael dykman On Tue, Oct 16, 2012 at 3:20 PM, Reindl Harald wrote: > > > Am 16.10.2

Re: Odd Behavior During Replication Start-Up

2012-10-16 Thread Reindl Harald
Am 16.10.2012 20:18, schrieb Tim Gustafson: > InnoDB: The log sequence number in ibdata files does not match > InnoDB: the log sequence number in the ib_logfiles! > 121016 10:40:20 InnoDB: Database was not shut down normally! > So, I went back to the master server, backed up the "foo" database

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread spameden
Interesting thought, but I get the same result. # Query_time: 0.001769 Lock_time: 0.001236 Rows_sent: 0 Rows_examined: 0 use kannel; SET timestamp=1350413592; select * from send_sms FORCE INDEX (priority_time) where time<=@ut order by priority limit 0,11; the MySQL i'm using is 5.5.28 from dotd

Odd Behavior During Replication Start-Up

2012-10-16 Thread Tim Gustafson
Hi, I have had a MySQL replication pair going for a while now, and we recently had some hardware issues on the slave. We've fixed the hardware issues on the slave, and now I went to re-start replication. I've done this probably 100 times, but for some reason I just cannot get this one to go, and

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread Michael Dykman
your now() statement is getting executed for every row on the select. try ptting the phrase up front as in: set @ut= unix_timestamp(now()) and then use that in your statement. On 2012-10-16 8:42 AM, "spameden" wrote: Will do. mysql> SHOW GLOBAL VARIABLES LIKE '%log%'; +---

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread spameden
Will do. mysql> SHOW GLOBAL VARIABLES LIKE '%log%'; +-+-+ | Variable_name | Value | +-+-+ | back_log

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread Shawn Green
On 10/15/2012 7:15 PM, spameden wrote: Thanks a lot for all your comments! I did disable Query cache before testing with set query_cache_type=OFF for the current session. I will report this to the MySQL bugs site later. First. What are all of your logging settings? SHOW GLOBAL VARIAB