Re: Dumping database names from bash with exclusion

2015-04-01 Thread Tim Johnson
* h...@tbbs.net  [150401 15:22]:
> On 2015/04/01 16:09, Tim Johnson wrote:
> >Using Mysql 5 on darwin (OS x).
> >This command
> >SELECT schema_name FROM information_schema.schemata WHERE
> >schema_name NOT IN
> >('mysql','information_schema','performance_schema');
> >as executed from the mysql prompt gives me a dump of all databases
> >except those not included in the tuple.
> >
> >This command
> >mysql -uroot -p** -e "SELECT schema_name FROM
> >information_schema.schemata WHERE schema_name NOT IN
> >('mysql','information_schema','performance_schema')"
> >
> >gives me a a dump of the entire mysql help screen, _not_ the
> >databases I am after.
> 
> Interesting ... when I try it, I get the output that, I suspect, you 
> want. Since mine is Windows cmd-line, I put it all on one line, but I 
> believe that all Unix-likes let one continue a string until finished.
> When I break the "e"-string off, I get a syntax error, as if entered 
> from the MySQL command prompt, semicolon too soon. I cannot get the 
> output that you describe unless I slip question-mark in.
  Thanks for the reply.

  I haven't gotten any simple -e or --execute= options to work on my
  Mac. I've got a dual-boot setup, so booted into ubuntu 14.04 and
  -e'command' works for any test that I tried. 

  I'd chalk it up to version or an OS difference, and my need is
  easy to be met with another approach.
 
  Cheers
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Dumping database names from bash with exclusion

2015-04-01 Thread Tim Johnson
Using Mysql 5 on darwin (OS x).
This command
SELECT schema_name FROM information_schema.schemata WHERE
schema_name NOT IN
('mysql','information_schema','performance_schema');
as executed from the mysql prompt gives me a dump of all databases
except those not included in the tuple.

This command
mysql -uroot -p** -e "SELECT schema_name FROM
information_schema.schemata WHERE schema_name NOT IN
('mysql','information_schema','performance_schema')"

gives me a a dump of the entire mysql help screen, _not_ the
databases I am after.

I could use some help on the correct syntax.

thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Importing a database as a data file directory

2014-10-05 Thread Tim Johnson
* Reindl Harald  [141005 13:12]:
> 
> Am 05.10.2014 um 21:29 schrieb Tim Johnson:
> >I have a dual-boot OS X/Ubuntu 12.04 arrangement on a mac mini. The
> >ubuntu system has failed and I am unable to boot it.
> >
> >I have one database on the ubuntu partition that was not backed up.
> >
> >I am able to mount the ubuntu partion with fuse-ext2 from Mac OS X,
> >thus I can read and copy the mysql data files at /var/lib/mysql on the
> >ubuntu partition.
> >
> >I presume that I should be able to retrieve the database by just
> >copying it to /opt/local/var/db/mysql5 - the location of the mysql
> >datafiles on the mac partition - and setting ownership and
> >permissions.
> >
> >So, this is a "Help me before I hurt myself" sort of question: Are
> >there any caveats and gotchas to consider?
> 
> in case of MyISAM a no-brainer
  Yup. MyISAM ... 
> * stop the db server
> * copy the folder there
> * set permissions
> * start the server
> * run "mysql_upgrade --force -u root -p"
 
  Great! thanks for the detail

> well, in case of replication you might want to rebuild the slave(s) from 
> scratch but that was it - doing this regulary to rsync whole databases 
> from stopped replication slaves as well as the document root on testing 
> machines
 Got it. 

Thank you


-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Importing a database as a data file directory

2014-10-05 Thread Tim Johnson
* Jan Steinman  [141005 13:12]:
> > So, this is a "Help me before I hurt myself" sort of question: Are
> > there any caveats and gotchas to consider?
 
> Do you know if the database was shut down properly? Or did Ubunto
> crash and die and your partition become unbootable while the
> database was in active use?
  The database had been shut down, no symptom occurred when the OS
  was booted, I just couldn't reboot (for starters) 

> Either way, you need to make sure MySQL is shut down when you move the files, 
> and then repair them after starting.
  Good tip. 

> I've had good experiences moving MyISAM files that way, but bad
> experience moving INNODB files. I suspect the latter are more
> aggressively cached.
  They are MyISAM ... 
  Thank you
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Importing a database as a data file directory

2014-10-05 Thread Tim Johnson
I have a dual-boot OS X/Ubuntu 12.04 arrangement on a mac mini. The
ubuntu system has failed and I am unable to boot it. 

I have one database on the ubuntu partition that was not backed up. 

I am able to mount the ubuntu partion with fuse-ext2 from Mac OS X,
thus I can read and copy the mysql data files at /var/lib/mysql on the
ubuntu partition.

I presume that I should be able to retrieve the database by just
copying it to /opt/local/var/db/mysql5 - the location of the mysql
datafiles on the mac partition - and setting ownership and
permissions.

So, this is a "Help me before I hurt myself" sort of question: Are
there any caveats and gotchas to consider?

thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Excluding MySQL database tables from mysqldump

2014-04-08 Thread Tim Johnson
* h...@tbbs.net  [140407 23:09]:
> >>>> 2014/04/07 08:02 -0800, Tim Johnson >>>>
>   2)mysqldump forces all database names to lower case in the "CREATE
>   DATABASE" statement. I know, one shouldn't use upper case in
>   database names, but :) tell that to my clients. 
> <<<<<<<<
> Why not? That is not mentioned in the section devoted to mapping such names 
> to the file-system.
  I found 'official' documentation here regarding Mac OS X:
  https://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

  I had also found some reference to this having been a side effect
  of migrating files from older macs (of which I am not familiar)
  filesystems. 

  I don't find any reference in the mysqldump documentation at
  https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html to any
  mechanism for overriding this.

  The incompatibility kicks in when trying to restore the databases
  on linux - and I presume FreeBSD, sun OS and other posix systems
  would show the same problem.

  Live and learn ...
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Excluding MySQL database tables from mysqldump

2014-04-07 Thread Tim Johnson
* shawn l.green  [140407 07:05]:
> Hello Tim,
> 
> On 4/4/2014 10:27 PM, Tim Johnson wrote:
> >* Tim Johnson  [140404 17:46]:
> >>Currently I'm running mysql on a Mac OSX partition.
> >>
> >>I have installed an ubuntu dual-booted partition and put mysql on
> >>it. I have already set up a mysql user on the ubuntu OS.
> >>
> >>In the past I have used mysqldump with just the --all-databases
> >>option to transfer data across different linux partitions.
> >>
> >>I'm wondering if I should explicitly exclude some of the tables from
> >>the mysql database. If so, which? perhaps mysql.user?
> >>
> >>thoughts? Opinions?
> >>thanks
> >   I should add the following:
> >
> >   1)the only user added to the new partition is the same as the
> >   primary non-root user on the Mac partition. Same credentials
> >
> >   2)this is a workstation - it is closed to the outside world.
> >
> >   FYI: ...
> >
> 
> There are several ways to select which data you want in the backup. You 
> can backup per-table, per-database, object type per database (routines, 
> triggers), or global objects (events). What level of detail you want to 
> copy from your old instance into your new instance is completely up to you.

  I've run into other problems, such as a 

  1)running mysqldump exactly as I would have in linux and not
  getting all databases. Dunno why, but keep on reading.

  2)mysqldump forces all database names to lower case in the "CREATE
  DATABASE" statement. I know, one shouldn't use upper case in
  database names, but :) tell that to my clients.

  It turns out '2)' is a known problem in Mac, but I just didn't
  know it...

  My workaround was to write a python app that uses the MySQLdb
  module to get the name of all databases, iterate through the list
  and selectively operate on them, and ensure that proper case is
  used in the "CREATE DATABASE" command..

  So I'm good here, I think.
  Thanks much for the reply.

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Excluding MySQL database tables from mysqldump

2014-04-04 Thread Tim Johnson
* Tim Johnson  [140404 17:46]:
> Currently I'm running mysql on a Mac OSX partition. 
> 
> I have installed an ubuntu dual-booted partition and put mysql on
> it. I have already set up a mysql user on the ubuntu OS. 
> 
> In the past I have used mysqldump with just the --all-databases
> option to transfer data across different linux partitions.
> 
> I'm wondering if I should explicitly exclude some of the tables from
> the mysql database. If so, which? perhaps mysql.user?
> 
> thoughts? Opinions?
> thanks
  I should add the following:

  1)the only user added to the new partition is the same as the
  primary non-root user on the Mac partition. Same credentials

  2)this is a workstation - it is closed to the outside world.

  FYI: ...
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Excluding MySQL database tables from mysqldump

2014-04-04 Thread Tim Johnson
Currently I'm running mysql on a Mac OSX partition. 

I have installed an ubuntu dual-booted partition and put mysql on
it. I have already set up a mysql user on the ubuntu OS. 

In the past I have used mysqldump with just the --all-databases
option to transfer data across different linux partitions.

I'm wondering if I should explicitly exclude some of the tables from
the mysql database. If so, which? perhaps mysql.user?

thoughts? Opinions?
thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-31 Thread Tim Johnson
* Reindl Harald  [121031 17:22]:
> 
> 
> Am 01.11.2012 01:54, schrieb Tim Johnson:
> > * Reindl Harald  [121031 08:12]:
> >> you MUST NOT use "localhost" if you want to connect to
> >> a different mysqld-port because "localhost" is unix-socket
> >>
> >> mysql -h 127.0.0.1 --port=3307 -u  -p
> >   I get "access denied" when I do that. 
> >   thanks
> 
> don't get me wrong - but do you have any clue about
> what you are doing?
  Did you not note that I have a solution? I am clearly
  aware of the options that you outline below.

  Let it go. You are ahead of me on your knowledge base and clearly
  you are trying to help everybody. I no longer need your help so
  don't waste your time on me. (this time)

  :) Maybe I will need you help again some day.
  In the meantime, good luck and keep up the good work!
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-31 Thread Tim Johnson
* Reindl Harald  [121031 08:12]:
> 
> 
> Am 31.10.2012 16:34, schrieb Tim Johnson:
> > * Johan De Meersman  [121031 07:10]:
> >   
> >> Given the different location of the datafiles and assuming the
> >> actual drupal does work, I'm starting to suspect that whatever
> >> installer you used created a second instance of mysql. Your drupal
> >> configfile should hold the necessary data to connect to it.
> > 
> >   You are correct. Running on 3307. (from settings.php) But even
> >   loging into that instance was not showing me the drupal
> >   databases - so I was stumped! I would guess that was because the
> >   3307 instance was using the system-wide my.cnf instead of the
> >   drupal my.cnf. I could not see from documentation how to invoke
> >   mysql or mysqldump with a specific my.cnf.
> >   See my response to your other email.
> >   thanks Johan
> 
> you MUST NOT use "localhost" if you want to connect to
> a different mysqld-port because "localhost" is unix-socket
> 
> mysql -h 127.0.0.1 --port=3307 -u  -p
  I get "access denied" when I do that. 
  thanks

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-31 Thread Tim Johnson
* Johan De Meersman  [121031 07:10]:
> Tim Johnson  wrote:
> 
> >* Ananda Kumar  [121030 09:48]:
> >> why dont u create a softlink
> > From /opt/local/var/db/mysql5/ to /opt/local/var/db/mysql5/ ???
> >
> > I can try that, but I am doing things to MySQL that I have never
> > done before and I am reluctant to risk clobbering a complex
> > development environment that has nothing to do with drupal.
> > After all, I am just "playing with" drupal.
> >
> > I'd welcome your elaboration or a second opinion.
 
> If I'm right about the second instance, that will cause the files
> to be opened by both daemons. Which is rather on the bad side of
> things.
  Sounds like good judgement on your part. As I have already posted
  to the ML, I was "forced" to use the drupal backup_migrate module.
  "When in drupal do as the drupals do".
  cheers 
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-31 Thread Tim Johnson
* Johan De Meersman  [121031 07:10]:
  
> Given the different location of the datafiles and assuming the
> actual drupal does work, I'm starting to suspect that whatever
> installer you used created a second instance of mysql. Your drupal
> configfile should hold the necessary data to connect to it.

  You are correct. Running on 3307. (from settings.php) But even
  loging into that instance was not showing me the drupal
  databases - so I was stumped! I would guess that was because the
  3307 instance was using the system-wide my.cnf instead of the
  drupal my.cnf. I could not see from documentation how to invoke
  mysql or mysqldump with a specific my.cnf.
  See my response to your other email.
  thanks Johan
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
* Tim Johnson  [121030 10:40]:
> OP :
> * Tim Johnson  [121029 16:28]:
<...snip>
> > I want to back up the mysql data for drupal.
> > However, I can't locate those databases and tables using MySQL
> > server or PHPMyAdmin, even if I start mysql on port 3307.
<...snip> 
>   Then I'm going to look at a drupal-specic (modular) way of doing
>   database management before anything else.  I'm an "under the hood"
>   kind of guy, but "when in drupal do as drupal does" (perhaps).
  I wanted to do this in a CLI mode and that's 'cuz I'm a CLI
 type of fellow. But as they say : "when in Rome (drupal) do as the
 Romans (drupals) do." 

 So, I installed the backup_migrate module and it created a backup
 file of .mysql extension without any effort
 :) Solved. 
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
OP :
* Tim Johnson  [121029 16:28]:
> I've recently unstalled drupal 7.15 on Mac OS X 10.7.
> 
> I want to back up the mysql data for drupal.
> However, I can't locate those databases and tables using MySQL
> server or PHPMyAdmin, even if I start mysql on port 3307.
> 
> The drupal mysql datafiles are located at
> /Applications/drupal-7.15-0/mysql/data
> 
> as opposed to /opt/local/var/db/mysql5 for
> 'customary' mysql.
  I will be gone for several hours.

  Then I'm going to look at a drupal-specic (modular) way of doing
  database management before anything else.  I'm an "under the hood"
  kind of guy, but "when in drupal do as drupal does" (perhaps).

  thanks for all of the replies
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
* Hassan Schroeder  [121030 08:25]:
> On Tue, Oct 30, 2012 at 9:12 AM, Tim Johnson  wrote:
> 
> >   I might try cp -p -r, but need a second opinion.
> 
> If you want to dump one or more databases, presumably you know
> the name(s); just use the mysqldump utility. Copying files is not the
> optimal way to save your data for most use cases.
  Hi Hassan :
  As you have probably noted, this thread has grown considerable and
  I did not post all issues in the OP, but the fact is:

  ** mysqldump, mysql, and phpmyadmin do not "see" the drupal DBs
 (presumably) because they are under a datadir that is not
 included in the my.cnf files that are being seached by mysql 
  **
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
* Ananda Kumar  [121030 09:48]:
> why dont u create a softlink
 From /opt/local/var/db/mysql5/ to /opt/local/var/db/mysql5/ ???

 I can try that, but I am doing things to MySQL that I have never
 done before and I am reluctant to risk clobbering a complex
 development environment that has nothing to do with drupal.
 After all, I am just "playing with" drupal.

 I'd welcome your elaboration or a second opinion.
 thanks

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
* Kishore Vaishnav  [121030 08:25]:
<...snip>
> Or the other option to install a module in Drupal "Backup &
> Restore" which can you just login thru drupal and you can take a
> dump of the existing database if you have admin credentials.
  OK. Use drupal directly? That makes sense. I see from
  http://drupal.org/node/22281 that there are backup and DB admin
  modules. I will take a look at them. 
  thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
* Reindl Harald  [121030 08:49]:
> >The drupal mysql datafiles are located at
> > /Applications/drupal-7.15-0/mysql/data
> >
> > as opposed to /opt/local/var/db/mysql5 for
> > 'customary' mysql.
> 
> this crap is outside your mysqldata
 I don't know what you mean by "crap". Sorry. 
 Actually I do ... you're about to embark on a rant about Mac.
 Go for it! :)

> and that is why it was suggested that you teporary change
> the datadir of your mysqld to /Applications/drupal-7.15-0/mysql/data
> or if this are only MyISAM-atbles FOR SURE you can simply move
> the database folders in your running mysqld-datadir
  What would you suggest as a fool-proof method to accomplish this?
  I hate to tweak the 'original' my.cnf, I could add a ~/.my.cnf
  but how would I do that without clobbering my 'non-drupal' mysql?

  I want to reiterate that cp -p -r might actually be the solution,
  but have not tried that approach in the past

> typical MacOSX-style to throw things around the whole
> machine without any logical structure like applications
> in the userhome.. this is the price someone has to
> pay for a poor operating system without package management
  Oh don't get me started! Grr! If truth be told, I'm a long-time
  linux user and new to OS X. 
  
  You are preaching to the converted my friend. 
  
  I'm not certain I like the way acquaire did the setup. I
  didn't have this problem when I played with drupal on ubuntu.

"""
Great minds run in the same gutter.
  -- Alaskus Curmudgeous
"""

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
* Shawn Green  [121030 09:01]:
> On 10/30/2012 12:34 PM, Tim Johnson wrote:
> >... snip ...
> >
> >   Clearly, I have failed to pose my question clearly, because the
> >   responses indicate that I have not been understood, so I will try
> >   again:
> >
> >   *
> >   mysqldump does not recognize the drupal databases!
> > Example :
> >   linus:prj tim$ mysqldump event -hlocalhost -utim
> >   -pXX > event.sql
> >   mysqldump: Got error: 1049: Unknown database 'event' when
> >   selecting the database
> >... snip ...
> 
> Your syntax is inverted. Put the name of the database at the end.
> 
> mysqldump -hlocalhost -utim -pXX event> event.sql
> 
> If you fail to do so, you would login as the 'anonymous user' if it is 
> still enabled on that machine and that account typically has zero 
> privileges.
  You are correct of course, but that does not solve the original
  problem.
  thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
* Tim Johnson  [121030 08:37]:
>   *
>   I remain as dumb as ever, but I hope I have made myself clearer
>   regards
  To elaborate further : See this entry from mysql --help
  """
  Default options are read from the following files in the given
  order:
  /etc/my.cnf /etc/mysql/my.cnf /opt/local/etc/mysql5/my.cnf
  ~/.my.cnf
  """
  /Applications/drupal-7.15-0/mysql/my.cnf is __not__ being read.
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
* Reindl Harald  [121030 08:25]:
> if it are MyISAM tables it is the best way because all data
> are in a folder with the database name - i never in my life
> used a dump to migrate mysql-databases while started with
> MySQL-3.x long years ago and moved them between Linux,
> Windows and MacOSX and we speak about some hundret databases
> with 5000 tables

  Clearly, I have failed to pose my question clearly, because the
  responses indicate that I have not been understood, so I will try
  again:

  *
  mysqldump does not recognize the drupal databases!
Example :
  linus:prj tim$ mysqldump event -hlocalhost -utim
  -pXX > event.sql
  mysqldump: Got error: 1049: Unknown database 'event' when
  selecting the database

  mysql does not find the drupal databases!

  PHPMyAdmin does not find the drupal databases!

  That is to say that my invocation of the applications above fails
  to find the drupal databases!
  *
  I remain as dumb as ever, but I hope I have made myself clearer
  regards
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Dumping drupal databases

2012-10-30 Thread Tim Johnson
* 小刀 <13488684...@163.com> [121029 18:43]:
> You can the the /etc/my.cnf and file the parameter about the data_dir
  I'm sorry. I don't understand.
  I might try cp -p -r, but need a second opinion.
  BTW: No need to CC me.

  thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Dumping drupal databases

2012-10-29 Thread Tim Johnson
I've recently unstalled drupal 7.15 on Mac OS X 10.7.

I want to back up the mysql data for drupal.
However, I can't locate those databases and tables using MySQL
server or PHPMyAdmin, even if I start mysql on port 3307.

The drupal mysql datafiles are located at
/Applications/drupal-7.15-0/mysql/data

as opposed to /opt/local/var/db/mysql5 for
'customary' mysql.

How can I accomplish this?
thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Editing/form interface

2012-01-19 Thread Tim Johnson
* Arthur Fuller  [120119 07:09]:
> You might want to have a look at our free utility called The_Usual, so
> named because it's what a regular customer says in a bar or restaurant.
> It's written in PHP and it does all the usual things such as Add, Edit,
> Search, and goes a bit further (master-detail forms, etc.) -- all
> automatically, based on the table definitions and declared foreign keys.
> See www.artfulsoftware.com.
  Thank you Arthur. I've downloaded it and am looking at the site.
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Editing/form interface

2012-01-18 Thread Tim Johnson
* Michael Dykman  [120118 16:04]:
> Tim,
> 
> I'm a dyed-in-the-wool console user myself.  
  :) As am I. Great minds run in the same gutter!

> I find the GUI tools make
> it quicker getting a project started, slower getting a project done
> so, no, I can't recommend a thing.
  I find that to be generally true. See my reply to Claudio. What I
  described at the end of my response would run from the command
  line and take a text file as input
  
  And as I can recall, producing HTML from Access resulted in some
  very messy html code. Easier for me to do it myself.

  cheers
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Editing/form interface

2012-01-18 Thread Tim Johnson
* Claudio Nanni  [120118 15:49]:
> Hi Tim,
  Hi Again Claudio: 
> Excuse me but still I don't understand exactly what is the product you want
> to build.
  I'm sorry, I'm not expressing myself well, I know it!
  I build all sorts of web-based products...
> One thing is a tool (IDE) to work and one thing is the product you build.
> 
> Some questions to understand:
> You ask for a tool name or a general question?
  Basically, I was inquiring as to whether there
  was a way to 
  1)Connect to a MySQL database
then:
  2)A wizard or a design tool to build an input form for a particular table.
Just as MS-Access or OpenOffice Base can do. (See my answer to
Michael)
then:
  3)Save form as an HTML form  
  Experimenting with OpenOffice has been unsatisfactory.
  As for MS-Access, I no longer use Windows (linux and Mac), nor do
  I currently have a market for work on Windows. 

> What are exactly the "mysql editing features" ?
  That is a general description. Like many web developers I
  use/develop HTML forms to edit MySQL databases.

> What are your "my view templates" ?
  ** Source documents for my MVC view templates **
  I use my own framework. It is derived by myself and used only for
  my clients or for my own apps.

> And again, are you building a client-server architecture
> application or a web based?

  Sorry. Web based.
 
  I appreciate your help, but I believe that I can easily develop the tool
  that I need.

  It would connect to MySQL with a specific table - column names
  optional - as a parameter and produce an input form - I could do
  in good time, but since I am self-employed, time is money for me,
  thus I looked for a shortcut and it appears none is available that
  would suit me:

  Since a I use a special markup for Javascript validation, I
  would have to add that by hand. My tool, since it would
  "understand" my framework could add most of the markup. 

  thanks again
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Editing/form interface

2012-01-18 Thread Tim Johnson
* Michael Dykman  [120118 13:00]:
> Mysql is a backend service and has no such application-level tools.
> 
> You can, however, use MS-Access (or any other such tool) and use MySL
> as a backend via an ODBC driver.
  Thanks Michael. I have use MS-Access in the past, but we no longer
  use Windows here. I've tried with Open Office, but it is not
  nearly as kind to work with as Access. Do you have any other
  recommendations?
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Editing/form interface

2012-01-18 Thread Tim Johnson
* Claudio Nanni  [120118 14:15]:
> Tim,
> 
> are you designing a client/server application or a web based one?
 Hi Claudio :

I am asking a general question. I have developed web-based apps
with mysql editing features for over 10 years now, but I am a
little lazy. Or to be more self-kind, I'm looking for tools that
can speed things up a bit. 

For instance, I think it would be great if there were a front end
to MySQL that would allow me to design forms like I used to for
MS-Access and then save them as html. I could then embed them in
my view templates.
 
I looked for such a feature in MySQLWorkBench, but like that
other responder said, not a 'front end'.

Thanks for the inquiry.
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Editing/form interface

2012-01-18 Thread Tim Johnson
Are there any utilities available that will enable the quick design
and implementation of forms for editing and adding records?

I.E. something like M$-Access or OpenOffice form designer/wizards.
thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: problem with installing MySQL 5.5 on OS Lion

2011-11-12 Thread Tim Johnson
* Martin Mueller  [12 13:42]:
<..> 
> In short, in my installation there seems a gap between mysql and mysql, and
> I can't find any good explanations for what I might have done wrong or how I
> could fix it. 
> 
> I'll be grateful for any help.
 
 I am probably not going to be very useful, but have you checked you
 environment? In particular $PATH. I recently transitioned from
 linux to mac lion and found out after some befuddlement that some
 terminal emulators provide environment variables that were not
 what I expected...

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysql server does not recognize user password

2011-10-19 Thread Tim Johnson
* Reindl Harald  [111018 23:24]:
> Am 19.10.2011 01:36, schrieb Tim Johnson:
> >> try "mysql -u tim -p"
> >  Same error:
> >  ERROR 1045 (28000): Access denied for user 'tim'@'localhost' (using 
> > password: NO)
> >> > and enter yur password in the followed dialog
> >  Doesn't even ask for the pwd..
> 
> then your mysql CLIENT is broken or somehow misconfigured or "overwritten" 
> with a dumb alias
> what says "which mysql"?
   you nailed it! Thank you.

  mysql $1 $2 ## where is $3?

  I've been trying to think of a way of covering up this dumb
  mistake, but I'm just going to come out and say it. 
  I'd set up this quick and dirty script (because at the time,
  being new to the OS, couldn't figure out how to do a proper alias
  or symlink)
  and forgot about it
  duh!

  thanks again for all the help. I actually learned some new tricks
  from you folks!
  regards
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysql server does not recognize user password

2011-10-18 Thread Tim Johnson
* Tim Johnson  [111018 17:47]:
Got this...

mysql> select host,user,password from user;
+-+--+---+
| host| user | password  | 
+-+--+---+
| localhost   | root |   | 
| linus.local | root |   | 
| 127.0.0.1   | root |   | 
| localhost   |  |   | 
| linus.local |  |   | 
| localhost   | tim  | *E8482E479FD05E800263C26A724513BBBFAA108B | 
| linus   | tim  | *E8482E479FD05E800263C26A724513BBBFAA108B | 
+-+--+---+
7 rows in set (0.00 sec)
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysql server does not recognize user password

2011-10-18 Thread Tim Johnson
* Claudio Nanni  [111018 17:02]:
> FLUSH PRIVILEGES is not needed when you use GRANT/REVOKE/CREATE USER
> etc,
> 
> Usually this problem comes when you have the anonymous user in the grant
> tables (''),
> MySQL has a tricky way of processing the grant tables.
> 
> Sometimes you can be surprised by what you read issuing:
> 
> SELECT USER(),CURRENT_USER();
linus:~ tim$ sudo mysql
Password:
.
mysql> SELECT USER(),CURRENT_USER();
+++
| USER() | CURRENT_USER() | 
+++
| root@localhost | root@localhost | 
+++
1 row in set (0.00 sec)
...hmm... on my linux box, where all works, I see
 'tim@localhost' 
> try this:
> 
> mysql -utim -psecret -h127.0.0.1 -P3306
linus:~ tim$ mysql -utim -p** -h127.0.0.1 -P3306
  ERROR 1045 (28000): Access denied for user 'tim'@'localhost' (using password: 
NO)

Thanks. 
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysql server does not recognize user password

2011-10-18 Thread Tim Johnson
* Reindl Harald  [111018 15:14]:
> 
> 
> Am 19.10.2011 01:03, schrieb Tim Johnson:
> > Now when I try to log in with host as localhost, user as tim
> > with 'secret' password:
> > linus:~ tim$ mysql --host=localhost --user=tim --password=secret
> > ERROR 1045 (28000): Access denied for user 'tim'@'localhost' (using 
> > password: NO)
> > Huh!
> 
> did you make "flush privileges"?
 Second time around, yes. Same problem
> you do not specify any password from the view of the server it seems ("using 
> password: NO")
 I am using the same syntax I use on my current machine, but your
 observation appears correct, mysql is _not_ seeing my password.
> try "mysql -u tim -p"
 Same error:
 ERROR 1045 (28000): Access denied for user 'tim'@'localhost' (using password: 
NO)
> and enter yur password in the followed dialog
 Doesn't even ask for the pwd..
> passwords in command-lines are really bad bacause they are in the processlist 
> and history
  I'm not concerned. Am closed to the outside world - these are not servers. 
> > If I login into the server as root again:
> > linus:~ tim$ sudo mysql
> > mysql> show grants for tim@localhost;
> 
> root without a password?
> jokingly
 Yup. It's been years since I set up mysql. I know I've missed
 something, but don't know what. 
 thank you
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysql server does not recognize user password

2011-10-18 Thread Tim Johnson
* Mark  [111018 15:14]:
> Did you issue a 'FLUSH PRIVILEGES;' before quitting the mysql session?
  Not originally, but I repeated the grant then
  issued
  flush privileges;
  quit
  and have the same problem
  thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



mysql server does not recognize user password

2011-10-18 Thread Tim Johnson
using 5.1.57 on Mac Lion.
 I've done this a dozen times, but I've missed something.
Am setting up a new mysql installation ...
I have granted a user as follows (between lines of asterisks)

linus:~ tim$ sudo mysql
Password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 20
Server version: 5.1.57 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> GRANT ALL PRIVILEGES ON *.* TO 'tim'@'localhost' IDENTIFIED BY 'secret'  
WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye

Now when I try to log in with host as localhost, user as tim
with 'secret' password:
linus:~ tim$ mysql --host=localhost --user=tim --password=secret
ERROR 1045 (28000): Access denied for user 'tim'@'localhost' (using password: 
NO)
Huh!
If I login into the server as root again:
linus:~ tim$ sudo mysql
mysql> show grants for tim@localhost;
+---+
| Grants for tim@localhost  
|
+---+
| GRANT ALL PRIVILEGES ON *.* TO 'tim'@'localhost' IDENTIFIED BY PASSWORD 
'*E8482E479FD05E800263C26A724513BBBFAA108B' WITH GRANT OPTION |
+---+
1 row in set (0.00 sec)
It appears that the user is there.
Is there a difference in the syntax with this version for providing
the password?
If I try 
mysql -h localhost -u tim -p
I get
ERROR 1045 (28000): Access denied for user 'tim'@'localhost' (using password: 
NO)
just as in the example above.
Have I forgotten to do something in the setup?

TIA
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Initial install instructions for mac lion/macports

2011-10-11 Thread Tim Johnson
* Brandon Phelps  [111011 07:43]:
> Tim,
 
> Just a reminder, as I am not sure if it is documented or not;
> After you get MySQL up and running via the DMG package be sure to
> install the System Preferences pane (it didn't use to install by
> default, not sure if it does now) which should be one of the icons
> you get when the DMG first opens, if I recall.  Once you get the
> system preferences pane installed you can access it and enable the
> Startup option so that MySQL starts whenever the system is booted.
> I am not sure what your requirements are but without the
> previously mentioned steps, if your machine loses power while you
> are away and is subsequently rebooted, you will not be able to
> access the database until you manually start the service.
 
> Hope this helps.
 Brandon, thanks a lot for that tip. I appreciate it. 

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Initial install instructions for mac lion/macports

2011-10-11 Thread Tim Johnson
* Tim Johnson  [111010 15:37]:
> I familiar with mysql on linux, as of late - ubuntu.
> I am installing mysql on a mac mini, with the Lion - osx 10.7
> operating system.
> 
> mysql-server was downloaded and built with macports.
> Following instructions included has not resulted in a successful
> startup.
 :) Last night before turning in, I thought that maybe I should have
 investigated the DMG option. It is clear from the respondents that
 I should do this. 
 Thanks a lot. I will uninstall via macports and use the package as
 recommended.
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Initial install instructions for mac lion/macports

2011-10-10 Thread Tim Johnson
I familiar with mysql on linux, as of late - ubuntu.
I am installing mysql on a mac mini, with the Lion - osx 10.7
operating system.

mysql-server was downloaded and built with macports.
Following instructions included has not resulted in a successful
startup.
I have recorded error messages, but it may suffice if I were pointed
to initial setup instructions for Mac Lion. So far, google has not
edified me.

TIA
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Optimizing column widths

2011-06-19 Thread Tim Johnson
* Dan Nelson  [110618 16:33]:
> In the last episode (Jun 18), Tim Johnson said:
> > Is there an optimal 'alignment' for column widths for
> > varchar types?
> > 
> > I.E., divisible by 8 or 10 or by powers of 2?
> 
> No.  Varchar fields are stored using only as many bytes as are in that
> particular entry.  The size in the column definition is simply the maximum
> allowed size.
> 
> http://dev.mysql.com/doc/refman/5.5/en/char.html
 Thanks Dan.
 :) Just checking.

-- 
Tim 
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Optimizing column widths

2011-06-18 Thread Tim Johnson
Is there an optimal 'alignment' for column widths for
varchar types?

I.E., divisible by 8 or 10 or by powers of 2?

URLs to documentation would be more than sufficient.

Version 5+, linux platforms.

thanks
-- 
Tim 
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Granting access rights to a user

2010-11-18 Thread Tim Johnson
* Tim Johnson  [101118 12:58]:
> * Tim Johnson  [101118 11:05]:
> > using 
> > mysql  Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu
> > 
> > I have root access to the mysql command line.
> > 
> > I need to grant access to user 'username' for all databases
> > except for the mysql database for both onsite (cgi script) and
> > remote access.
> > 
> > What is the syntax?
>  here is what I did to solve this:
>  As root I issued from the mysql DB: 
>  SHOW GRANTS FOR username@'%';
>  Then making note of the stored grant commands
>  issued 
>  GRANT ALL PRIVILEGES ON `dbname`.* TO 'username'@'%' WITH GRANT
>  OPTION
>  for which tables I need access for 'username'.
  michael dykman points out (OTL) that it is not a good idea to give
  a user a grant option
  
  The syntax for removing the grant option is:
  REVOKE GRANT OPTION ON databasename.* FROM 'username'@'%';

  at least that is what I deduce from docs and
  `show grants for user;'
  displays user privileges without the grant option.
  :) I'm cleaning up after someone else.
  cheers
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Granting access rights to a user

2010-11-18 Thread Tim Johnson
* Tim Johnson  [101118 11:05]:
> using 
> mysql  Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu
> 
> I have root access to the mysql command line.
> 
> I need to grant access to user 'username' for all databases
> except for the mysql database for both onsite (cgi script) and
> remote access.
> 
> What is the syntax?
 here is what I did to solve this:
 As root I issued from the mysql DB: 
 SHOW GRANTS FOR username@'%';
 Then making note of the stored grant commands
 issued 
 GRANT ALL PRIVILEGES ON `dbname`.* TO 'username'@'%' WITH GRANT
 OPTION
 for which tables I need access for 'username'.

-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Granting access rights to a user

2010-11-18 Thread Tim Johnson
using 
mysql  Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu

I have root access to the mysql command line.

I need to grant access to user 'username' for all databases
except for the mysql database for both onsite (cgi script) and
remote access.

What is the syntax?

-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: C API Function for count(*)

2010-05-15 Thread Tim Johnson
* Bob Cole  [100515 06:58]:
> You might get closer to what you want if you put your command in a text file 
> and run it from the command line.
> On a Mac OS X, I put a similar command:
>  select count(*) from testTable;
> into a small text file: 
>  testCount.txt
> and ran this command from the Terminal:
>  mysql -u username -ppassword < /Users/myname/Documents/testCount.txt
> The result was:
>  COUNT(*)
>  12
  Hi Bob:

  That's a good trick. It doesn't "fit" the API that I am trying to
  enhance, but it could be a good workaround by 'echo'ing to
  a tmpfile. 

 Thanks.
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: C API Function for count(*)

2010-05-15 Thread Tim Johnson
* Dan Nelson  [100514 21:38]:
> 
> You can't do it with one function call, but you can do it, since the MySQL
> cli was able to print "16" in your example above, and it was written in C. 
> Take a look at mysql_store_result(), mysql_num_fields(),
> mysql_field_count(), mysql_fetch_row(), and mysql_fetch_lengths().  There's
> a simple code fragment to print a resultset on this page:
> 
> http://dev.mysql.com/doc/refman/5.1/en/mysql-fetch-row.html
  Thanks Dan. I can use the C code there to model the
  code for the API.
  cheers
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



C API Function for count(*)

2010-05-14 Thread Tim Johnson
I have MySQL version 5.0.84 on linux slackware 13.0 32-bit.  

I am working with a relatively new API written in a programming
language with a small user base (newlisp). The newlisp API imports a
number of C API functions from the system MySQL shared object. 

If I were to issue a count(*) query from my monitor
interface:
Example:
mysql> select count(*) from clients;
+--+
| count(*) |
+--+
|   16 |
+--+

If "select count(*) from clients" is issued from the newlisp API, is
there a a C API function that would return '16'?

I have reviewed
http://dev.mysql.com/doc/refman/5.1/en/c-api-functions.html
and haven't been enlightened so far.

I believe that I could parse the results as a string, but
if I could access count(*) as a C function, it would be
more efficient. 

I have a background in C.
thanks
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Need MySQL Logo for public use.

2009-05-09 Thread Tim Johnson
Since MySQL is one of our tools, we would like to have
a logo that we can use at our website. And we will use
it to link back to the MySQL site.

Can someone point me to MySQL logos that I can legitimately
use? 

Thanks
Tim

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



mysqldump -T - Insert headers?

2008-08-19 Thread Tim Johnson
Hi:
Using mysql 5.0.45 on linux 2.6.22-15 (ubuntu).
I can create tab-deliminated text files using mysqldump -T, but
I haven't found a way to include a header with column names.
Any ideas?
It's any easy task for me to extract them with a script, but if
mysqldump can do it, so much for the better.
TIA
Tim

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: unescaping strings with the C api

2008-06-12 Thread Tim Johnson
On Thursday 12 June 2008, David Giragosian wrote:
 
> The same is true of mysql_real_escape_string() in PHP. You escape
> special characters upon update or insertion, but upon viewing the data
> in the DB or retrieving it programmatically, the data simply appear as
> it was originally before use of the function.
 Yup. The API takes care of it all . definitely a case for using the API
 over TCP/IP
tim



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: unescaping strings with the C api

2008-06-12 Thread Tim Johnson
On Thursday 12 June 2008, Warren Young wrote:
> Tim Johnson wrote:
> >   Not sure what you mean by "directly usable".
>
> I mean "directly usable". :)
>
> >   If I do an insert statement with a backslash, for example:
> >   "headline\one", I will retrieve "headline\\one", and that will
> >   need to be unescaped, because it is not a true representation
> >   of what was submitted by the original insert.
>
> My perspective is a little different from yours: as the maintainer of
> MySQL++ (http://tangentsoft.net/mysql++/), I have never actually used
> the C API directly.  I don't have any pure C sample code here to tweak
> to try things.
 Me neither - not any more anyway, since I quit coding in C & C++ years ago..
 Furthermore, I am also working with a scripting language new to me.
 My experience is with python - where unescaping is _not_ an issue and
 rebol, where unescaping _is_ an issue. Python using the API (somewhere
 buried deep in the MySQLdb modules, and rebol using a direct socket
 connection on port 3306.

> Instead, I changed one of the MySQL++ examples to insert a string with a
> backslash into the DB, and on retrieving the rows, I get a single
> backslash.  In the C++ code, the backslash is doubled due to C/C++
> string parsing rules, but that's only one character in the underlying
> string data.  Due to the way this example uses MySQL++, that string gets
> automatically escaped on DB insertion, so I presume it's sent over the
> wire as two backslashes, though I haven't verified it.  Then when you
> retrieve rows through MySQL++, it returns a fairly direct copy of the
> data the C API gives you, with no real translation going on.
  I'm seeing the same that you are with the language (newlisp) that I am
  "playing" with.
>
> MySQL++ doesn't have an "unescape" function, so I don't see why your
> program would need one.
 I believe that you are correct. If not a single regex should handle it, and 
be fairly fast.
Thanks for the input. I really appreciate it.
Best regards
tim(looking at MySQL++)


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: unescaping strings with the C api

2008-06-12 Thread Tim Johnson
On Thursday 12 June 2008, Warren Young wrote:
> Tim Johnson wrote:
> > I can not locate a C api function to _unescape_ strings.
>
> Why do you believe you need one?
>
> You need to escape strings when building SQL query strings to avoid
> problems with quote characters, which are special in SQL.  When MySQL
> returns the queried data to your program, it's not using a SQL query to
> do so.  It just gives the data back in a directly usable form.
  Not sure what you mean by "directly usable".
  If I do an insert statement with a backslash, for example:
  "headline\one", I will retrieve "headline\\one", and that will
  need to be unescaped, because it is not a true representation
  of what was submitted by the original insert.
  tim


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



unescaping strings with the C api

2008-06-12 Thread Tim Johnson
Using MySQL 5.0.45 on linux.
For the first time I am using the C API directly. I am using
mysql_real_escape_string() - see
http://dev.mysql.com/doc/refman/5.1/en/mysql-real-escape-string.html

I can not locate a C api function to _unescape_ strings. If there were one,
I would use it. If I have overlooked something in the API, I would welcome
comments. I am familiar with methods outside of the API for unescaping.

Thanks
Tim

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't find file: './mysql/(database_name).frm'

2007-10-31 Thread Tim Johnson
Regarding this issue, I have found that by rebooting the computer,
these problems have gone away (for now). I have a feeling that
this was a subtle permission/ownership problem. Some of the
databases were installed by direct file copy. although this method
has worked well for me on slackware and redhat machines, I'm
going to avoid doing this in the future for ubuntu if I can.
 
On Tuesday 30 October 2007, Warren Young wrote:
> Tim Johnson wrote:
> >> It isn't "broken," per se.
> >
> >   When you say that it isn't "broken", could you please elaborate?
>
> Once again: It seems to me that you're seeing a purposeful choice of
> configuration.  It could very well be that the configuration makes sense
> in some one's use.  The fact that it breaks for you doesn't mean the
> configuration makes no sense.
>
> I don't know for a fact that this is what's going on.  I don't use
> Ubuntu.  I'm just trying to find an explanation for why it is the way it
> is.
Just a quick note regarding ubuntu. To make a long story short, I
moved from slack to ubuntu because of the debian package-management system,
which is "inherited" by ubuntu. When mysql is installed via the debian package
management system, the binaries being installed have been built and 
maintained by the ubuntu development team. From what I know, this team is
well-funded and very able. And the binaries are built for ubuntu in
the "ubuntu way"

> ... why then are you continuing to argue back and
> forth instead of going to mysql.com and getting a different set of
> binaries to try?  You could have done that about five times in the time
> it's took to have this exchange.  Even if it didn't work, we'd be
> farther along towards a solution by now.

Not necessarily. Read on:
I own a software development company. I have been a database programmer
for 18 years, I'm proficient in C/C++/assembler/VBA/Python/Rebol/javascript
to name just a few. I've used mysql for 7 years, have built my own DBMSs
from scratch. I've worked on VAX, DOS, windows, Redhat linux, slackware linux
and now ubuntu. I wear the badge of "hacker" proudly.
*
*but*
*
I believe that in windows, there is a "windows way", in redhat, there is a
"redhat way"  in slackware, there is the "slackware way", and in ubuntu
there is the "ubuntu way".

I stuck with the "ubuntu way" because I am now on ubuntu. It is likely that 
using binaries *not* built for ubuntu would just compound the problem.

Given the very, very, large user base of MySQL and the large user base of
ubuntu and the distinct characteristics of the debian package management
system, which is not only used by ubuntu, but by others - it would be worthy
to have a ubuntu(debian)-specific support community for mysql.

Enuff said. I'm done.
Tim

 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't find file: './mysql/(database_name).frm'

2007-10-30 Thread Tim Johnson
On Tuesday 30 October 2007, Warren Young wrote:
> Tim Johnson wrote:
> >> It isn't "broken," per se.
> >
> >   When you say that it isn't "broken", could you please elaborate?
>
> Once again: It seems to me that you're seeing a purposeful choice of
> configuration.  It could very well be that the configuration makes sense
> in some one's use.  The fact that it breaks for you doesn't mean the
> configuration makes no sense.
>
> I don't know for a fact that this is what's going on.  I don't use
> Ubuntu.  I'm just trying to find an explanation for why it is the way it
> is.
>
> >And thanks in advance, because, from where I'm sitting, time is money
> >and I know that it takes time to answers these emails.
>
> I'm glad you see that, but why then are you continuing to argue back and
> forth instead of going to mysql.com and getting a different set of
> binaries to try?  You could have done that about five times in the time
> it's took to have this exchange.  Even if it didn't work, we'd be
> farther along towards a solution by now.

I am not arguing. I am being cautious. If I were on a slack or redhat system,
which I'm more familiar with, I would have reinstalled already. 

I'm going to refer this to a a debian or ubuntu list and see what responses I 
get before I do anything further. 

Thanks for your help. Don't make an argument where none exists :-).
tim

 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't find file: './mysql/(database_name).frm'

2007-10-30 Thread Tim Johnson
On Tuesday 30 October 2007, Warren Young wrote:
> Tim Johnson wrote:
> > Is there a possible repair routine to run?
>
> It isn't "broken," per se.
  
  When you say that it isn't "broken", could you please elaborate?
   And thanks in advance, because, from where I'm sitting, time is money
   and I know that it takes time to answers these emails.

> Someone chose to build it with this configuration, and presumably that
> person made a choice that is sensible for their needs.
> If it doesn't 
> work for you, you can either build MySQL from source with the
> configuration choices you like, or switch to another build that has
> defaults you like.  That's why I suggested downloading the official
> binaries from mysql.com: they work for most people.

Do I understand that you think that this problem comes from the way that the
ubuntu development team built mysql?

I find this very strange, considering that I have installed mysql on on ubuntu
before without this problem. What I did do different on this install was copy
some (but not all) directly to /var/lib/mysql/(database_name). I'm also very
nervous about mixing the install of of binaries with a fairly succesful update
schema - that is - the debian based package management system.

Regards
Tim






-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't find file: './mysql/(database_name).frm'

2007-10-30 Thread Tim Johnson
On Tuesday 30 October 2007, Warren Young wrote:
> Tim Johnson wrote:
> > The file pattern is *not* as I expressed it above.
>
> Yeah, I figured that out, and ignored the error in my reply.
>
> The answer remains the same: unless you're purposefully doing something
> weird, there's a configuration error in that MySQL build.  It's not that
> the configuration cannot possibly be right, just that it's unlikely to
> be correct.

Is there a possible repair routine to run?
Tim

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't find file: './mysql/(database_name).frm'

2007-10-30 Thread Tim Johnson
On Tuesday 30 October 2007, Warren Young wrote:
> Tim Johnson wrote:
> > Can't find file: './mysql/(database_name).frm' for numerous databases.
>
> That's the file the actual table data is stored in.  Unless you're on a
> shared machine and are trying to run a private copy of MySQL, you
> probably don't mean to put store table data in a subdirectory of the
> current directory ("./mysql").  Typically this stuff goes in
> /var/lib/mysql   If that's what you want, you can either override the
> defaults by setting up a custom my.cnf or get a build of MySQL that has
> the defaults set sanely for your needs.
>
> Perhaps the Ubuntu 6.06 LTS binaries you can download from mysql.com
> will work on your newer system.  If so, you can be sure they'll be
> configured sanely.

Oops! Wrongly worded subject and problem.

The file pattern is *not* as I expressed it above.
It should be
./(database_name)/(table_name).frm
IOWS:
If it is a problem with the mysql database and the time_zone_name table
the error references './mysql/time_zone_name.frm'
If it is a problem with database 'project' and table 'customer'
then the error references './project/customer.frm'
I hope that is clearer.
thanks
tim

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Can't find file: './mysql/(database_name).frm'

2007-10-30 Thread Tim Johnson
using Distrib 5.0.45 on ubuntu 7.04, mysql was installed via adept manager.
I'm getting many error messages on the type:

Can't find file: './mysql/(database_name).frm' for numerous databases.

The mysql database was installed automatically during installation, and
I'm getting them for ./mysql/time_zone_name.frm.
Also:
I'm getting these type of messages from databases that were installed
manually via mysq and a script file.
And:
 I'm getting them from databases installed by directly copying to
/var/lib/mysql/(database name) from other machines.

In each case, I find that the ownership is set at mysql:mysql and
permissions at 660.

I'd like to resolve this problem ASAP as it is driving me crazy :-), so
any help would be appreciated.

thanks
tim 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Post Installation for Mysql on Ubuntu

2007-10-28 Thread Tim Johnson
Hello:
I am preparing to install the latest mysql server on ubuntu - I think it will
be version 5+. It has been some time since I have done a setup and I would
appreciate updated instructions.

The ubuntu install via Adept Manager will ask for a root password.
Following that I know that I must add one or more user accounts.
I see some good info at 
http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html

Any other good examples would be welcome.
Thanks
Tim

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Update error on ver 3.23, works on ver 5.0

2007-08-02 Thread Tim Johnson
On Thursday 02 August 2007, Tim Johnson wrote:
> Hi:
> I use 5.0.38 on my ubuntu desktop
> and I have to work with ver 3.23.56 on a solaris-based server.
>
> The following update query:
> UPDATE wine_list,FRED SET wine_list.wine_ID=FRED.WMJ_ID WHERE
> wine_list.wine_ID=FRED.wine_ID;
>
> works on 5.038, but on 3.23.56 I get the following:
> ERROR 1064 (0): You have an error in your SQL syntax near 'FRED SET
> wine_list.wine_ID=FRED.WMJ_ID WHERE wine_list.wine_ID=FRED.wine_ID' at line
   :-) Now I know why I upgraded from 3~ - it looks like the ability to 
update a table with values from another table was added at version 4.04.

I could dump the table, run the update on my desktop and re-install, *but* 
time is of the essence, 'cuz an update of wine_list on the server while I'm 
operating on it on my desktop could cause some grief...

any other ideas?

thanks
tim

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Update error on ver 3.23, works on ver 5.0

2007-08-02 Thread Tim Johnson
Hi:
I use 5.0.38 on my ubuntu desktop
and I have to work with ver 3.23.56 on a solaris-based server.

The following update query:
UPDATE wine_list,FRED SET wine_list.wine_ID=FRED.WMJ_ID WHERE 
wine_list.wine_ID=FRED.wine_ID;

works on 5.038, but on 3.23.56 I get the following:
ERROR 1064 (0): You have an error in your SQL syntax near 'FRED SET 
wine_list.wine_ID=FRED.WMJ_ID WHERE wine_list.wine_ID=FRED.wine_ID' at line 1

Any ideas on how to make it work? Pointers to error codes would be helpful, 
also.

thanks
tim

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Setting a field to NULL (default value)

2007-04-16 Thread Tim Johnson
On Monday 16 April 2007 07:56, Tim Johnson wrote:
> Hi:
> I have a table with a column of type char(120).
> default is NULL
> How do I a set a 'cell' back to NULL?
> Example:
> alter customers set all_colslist=NULL where ID=57;
> returns a syntax error.
> Mysql version 4.0.20
> thanks
This is embarrassing I used alter instead of update.
I should not start work before having all of my coffee. :-)
Correct syntax is 
update customers set all_colslist=NULL where ID=57;
   |
sorry!
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
Palmer, Alaska, USA

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Setting a field to NULL (default value)

2007-04-16 Thread Tim Johnson
Hi:
I have a table with a column of type char(120).
default is NULL
How do I a set a 'cell' back to NULL?
Example:
alter customers set all_colslist=NULL where ID=57;
returns a syntax error.
Mysql version 4.0.20
thanks
-- 
Tim Johnson <[EMAIL PROTECTED]>
Palmer, Alaska, USA

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
On Wednesday 21 February 2007 17:51, Paul McCullagh wrote:
> Hi Tim,
Hello Paul
> Foreign key definitions are parsed but ignored by MyISAM tables.
 Understood. Thanks
> Try InnoDB or PBXT (http://www.primebase.com/xt) :)
 for the time being, I'm going to stick with MyISAM. I've
 got a possible solution I will try later - and the target is
 a online accounting system for a *very* small company (mine)
 with a *very* small number of clients.
  
Here we go - it's weird, but it might work.
 I use a default value, which is itself a foreign key that
 point to a "meta-table"
  example
status int(6) default 1, 
1 is the ID for a table with columns `ID` & 'descriptor`, where the
 desciptor field holds something like this "provider_status.ID.title"
 the script executes the "show cols" query, then queries the "metadata"
 table where  "provider_status.ID.title" tells the script to pull
 `ID' and `title' from provider_status and load the values into a
 select/option list form entity.

I'm sure that this will not be optimal performance-wise, but where speed 
is not an issue, will save much coding time.
Since it will be the weekend before I try this out, I welcome observations
and any references to meta-data approaches using MySQL /MyISAM.

Thanks to everybody for the quick responses.
regards
-- 
Tim Johnson <[EMAIL PROTECTED]>
Palmer, Alaska, USA
Alaska Internet Solutions (2 hairy guys in log cabins)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
On Wednesday 21 February 2007 17:43, Rolando Edwards wrote:
> SHOW INDEXES FROM `providers`;
>
> By the way, what version of MySQL are you using ???

4.0.20
 
-- 
Tim Johnson <[EMAIL PROTECTED]>
Palmer, Alaska, USA

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
On Wednesday 21 February 2007 17:01, Rolando Edwards wrote:
> SHOW CREATE TABLE providers\G
 Hi Rolando:
That doesn't do it on my machine (linux, ver 4.0.2)
Here's what I see
mysql> SHOW CREATE TABLE providers\G
*** 1. row ***
   Table: providers
Create Table: CREATE TABLE `providers` (
  `ID` int(11) NOT NULL auto_increment,
  `name` varchar(80) NOT NULL default '**',
  `nick_name` varchar(10) NOT NULL default '**',
  `email_address` varchar(80) NOT NULL default '**',
  `start_date` date NOT NULL default '-00-00',
  `company_ID` int(11) NOT NULL default '0',
  `status` int(6) default NULL,
  `modified` timestamp(10) NOT NULL,
  UNIQUE KEY `ID` (`ID`)
) TYPE=MyISAM
1 row in set (0.00 sec)

As you can see there is no reference info for column `status`
thanks
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
Palmer, Alaska, USA

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
Hi: 
Below is the following relevant create table syntax
CREATE Table providers(
  [snipped]
  FOREIGN KEY (status) REFERENCES provider_status(ID,title),
  UNIQUE KEY ID (ID)
) TYPE=MyISAM;

and below is the relevant output from a describe query:
mysql> show columns from providers;
+---+---+--+-+++
| Field| Type   | Null   | Key | Default| Extra 
 
+---+---+--+-+++
| status   | int(6)   | YES  || NULL   |

+---+---+--+-+++

Is there a syntax equivalent of 'describe' that can show me the references?
thanks
tim
-- 
Tim Johnson <[EMAIL PROTECTED]>
Palmer, Alaska, USA

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Updating from 4.0.20 to 5.0.27

2007-02-06 Thread Tim Johnson
Hello:

I'm currently using OS linux slackware 10.0 with MySQL version 4.0.20
I currently use python and rebol APIs to MySQL, not PHP.

I've downloaded mysql-standard-5.0.27-linux-i686.tar.gz
Questions:
  Should I first upgrade to to an intermediate version?
IF so, which?
  URLs to relevant documentation?
thanks
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Cloning a table with different column names

2007-02-05 Thread Tim Johnson
On Monday 05 February 2007 10:07 pm, Rolando Edwards wrote:
  Hi Roland:
> Here is something convoluted and sick ...
convoluted and sick can work. I actually had something
   equally convoluted and sick in mind, but was fishing
   for a second opinion

> run 'mysqldump --no-data  ' and redirect to a text
> file. change the table name and column names in the text file as desired
> (using perl) run mysql client redirect input from the text file
>
> Something with more dignity (and no perl)

 Perl = no dignity? My biz partner likes perl

> create table  like ;
> alter table  add  column column-2  after
> column-1; alter table  drop column column-1;
  
  Wham! I like LIKE!
   thanks
   tim

> Give a try (the latter one, of course)
>
> ----- Original Message -
> From: "Tim Johnson" <[EMAIL PROTECTED]>
> To: "MySQL General Mailing List" 
> Sent: Tuesday, February 6, 2007 7:15:12 AM (GMT-0500) US/Eastern
> Subject: Cloning a table with different column names
>
> Hello:
>
> I have a need to create two tables from imported data.
> The only difference between the tables is the column names.
>
> The data will be the same.
>
> Can anyone propose a mysql method to create a new table
> from an existing table with new column names?
>
> thanks
> tim
> --
> Tim Johnson <[EMAIL PROTECTED]>

-- 
Tim Johnson <[EMAIL PROTECTED]>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Cloning a table with different column names

2007-02-05 Thread Tim Johnson
Hello:

I have a need to create two tables from imported data.
The only difference between the tables is the column names.

The data will be the same.

Can anyone propose a mysql method to create a new table
from an existing table with new column names?

thanks
tim
-- 
Tim Johnson <[EMAIL PROTECTED]>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: "linking" rows

2006-02-23 Thread Tim Johnson
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [060223 09:09]:
> Tim Johnson <[EMAIL PROTECTED]> wrote on 02/23/2006 12:26:35 PM:
> > I need the most efficient way to do this: examples, keywords, and
> > URLs to relevant documentation are all welcome.
<> 
> First off, columns can either be numeric or character-based not both. You 
> can store arrangements of the characters "0" through "9" in a 
> character-based field but those are not numbers, they are strings that 
> look like numbers.
 
  Of course. Didn't mean to imply other wish.

> Your description makes it sound like you have a table that has data in a 
> column called 'city' that looks like:
> 
> Atlanta
> Boston
> 15
> 10
> 24
> Paris
> Rome
> 215
> Tokyo
> 
> or am I mistaken? 
 
  You got it.

> Back to your direct question: How you "link" two tables is called 
> "joining". There are tons of examples and tutorials of how to join tables. 
> One of my favorites is
 
  Deliberately left out an inquery about "join" to encourage possibly
  other suggestions. :-)

> http://sqlzoo.net/
 
> I also recommend you read this article about normalization:
> http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html

 Those are the links that I needed. Getting up to speed on 'join is my
 solution...

 Thanks
 (time to do my homework)
 tim
  
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



"linking" rows

2006-02-23 Thread Tim Johnson
Let's say I have a query that performs

"select * from Account"

one of the columns from "Account" (city) is actually a key which may
be either numeric or character.

There is a table called "City" which contains keys and names of cities.

and I want the City.Name value where Account.city matches City.ID.

I need the most efficient way to do this: examples, keywords, and
URLs to relevant documentation are all welcome.

thanks
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: MySQLD aborts

2005-08-21 Thread Tim Johnson
<...> 
> You can get more info about an error message with perror:
> 
>   ~: perror 13
>   OS error code  13:  Permission denied
> 
> As you guessed, a permissions error.  Apparently, the user running mysqld 
> (usually user mysql) does not have access rights to /var/lib/mysql/.  Most 
> likely, user mysql is not set as the owner of /var/lib/mysql/, in which 
> case you need to
> 
>   chown -R mysql:mysql /var/lib/mysql/
> 
> as root.

  Bingo! That worked and I learned *two* things. :-)
  thanks
  tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



MySQLD aborts

2005-08-21 Thread Tim Johnson
Hi:
I have version 4.0.20 on slack 10.0.
Mysqld fails on startup.

>From mysqld is the following:

50821 11:10:44  mysqld started
050821 11:10:44  Warning: Can't create test file /var/lib/mysql/linus.lower-test
^G/usr/libexec/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
050821 11:10:44  Aborting

050821 11:10:44  /usr/libexec/mysqld: Shutdown Complete

050821 11:10:44  mysqld ended
-
I'm not much of a linux system guru, and I am guessing from
the messages above that I have a problem with permissions. 

Can anyone point me to the solution?
Many Thanks
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Post-Installation Setup Problems: error[2002 1604]

2005-08-15 Thread Tim Johnson
* Gleb Paharenko <[EMAIL PROTECTED]> [050815 10:59]:
> Hello.
> 
> 
> > I'm getting the following problems:
> > Login Problem:
> 
> See:
>   http://dev.mysql.com/doc/mysql/en/can-not-connect-to-server.html
 
  That's going to be really helpful. Thanks.
> 
> > Problems unencrypting password:
> 
> OLD_PASSWORD() is available as of MySQL 4.1. 4.0.20 is a very old
> version. I strongly recommend you to upgrade to the latest release
> (4.1.13 now).

  it get worse . most of my commercial work is running on 
servers with ver 3.23.X (sun and RH servers). I enjoy a
great relationship with my domain hoster (who is also a
programmer who uses mysql a lot), but he has been very 
cautious about upgrading any of his servers, being 
concerned about code breaking, etc.

 What argument might be provided to him to upgrade and what caveats
 might be cited?

 Thanks very much for the pointer to the docs.
 regards
 tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Post-Installation Setup Problems: error[2002 1604]

2005-08-14 Thread Tim Johnson
Hello:
OS: Linux Slackware 10.0
Ver: 4.0.20
Network Status: Closed to "outside world"

After installation:
I'm getting the following problems:

Login Problem:

mysql --host=localhost --user=root --password=**
ERROR 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (13)

What works:
mysql -u tim -p
Enter password: *   # works
---
Problems unencrypting password:
SET PASSWORD FOR 'tim'@'localhost' = OLD_PASSWORD('**')
ERROR 1064: You have an error in your SQL syntax.  Check the manual that
corresponds to your MySQL server version for the right syntax to use
near
'OLD_PASSWORD('marion')' at line 1

## Note: am unclear what is wrong with syntax
## Host table dump below:
SELECT Host, User FROM mysql.user;
 +---+--+
 | Host  | User |
 +---+--+
 | linus |  |
 | linus | root |
 | linus | tim  |
 | linus.johnson.com | tim  |
 | localhost |  |
 | localhost | root |
 | localhost | tim  |
 +---+--+

Any advice is appreciated:
Am working from the installed docs.

Thanks
tj

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Linux vs. Windows?

2005-08-12 Thread Tim Johnson
* Jay Blanchard <[EMAIL PROTECTED]> [050812 07:32]:
> [snip]
> On Fri, 2005-08-12 at 09:55 -0500, Jay Blanchard wrote:
> > [snip]
> > Same machine, any performance difference?
> > [/snip]
> > 
> > Yes. Linux will consistently outperform Windows in many areas.
> 
> Except for those areas that it doesn't.
> [/snip]

  The best situation might be a combination of both.
  But wait! That's what I have. Boot up linux, then
  start windows in it's own desktop. Best of both
  worlds!

  And lately, I've been using MS-Access to help design
  and think about MySQL databases.

  MTCW
  tj
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: libmySQL.so location

2005-07-23 Thread Tim Johnson
* Tim Johnson <[EMAIL PROTECTED]> [050723 10:42]:
> * sol beach <[EMAIL PROTECTED]> [050723 09:15]:
> > I suspect a case problem
>   Hello sol:
>   I'm using a case insensitive seach.
>   i.e.:
>   
>   [EMAIL PROTECTED] tim]$ locate -i libmysql.so
>   [EMAIL PROTECTED] tim]$ 

 Needed libdbi-0.6.5-5.i386.rpm and
   libdbi-dbd-mysql-0.6.5-5.i386.rpm

 Life Is Good .
 tj

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: libmySQL.so location

2005-07-23 Thread Tim Johnson
* sol beach <[EMAIL PROTECTED]> [050723 09:15]:
> I suspect a case problem
  Hello sol:
  I'm using a case insensitive seach.
  i.e.:
  
  [EMAIL PROTECTED] tim]$ locate -i libmysql.so
  [EMAIL PROTECTED] tim]$ 
  
  same results as root
  thanks
  tim
  
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



libmySQL.so location

2005-07-23 Thread Tim Johnson
Using mysql 3.23 on Red Hat 9.0 partition,
  mysql 4.0.20 on Slack 10.0 partition.
I have reviewed some code for a lisp mysql library using
the Foreign Function Interface (exposing the "C" API).

the shared object referenced in the code is libmySQL.so.
I am not able to locate a file with that name on either of
my linux partitions. The library developer is primarily a
windows programmer and has told me that this file should
be included with the distribution.

Can anyone clarify this matter for me? Do I need a symlink?
If so to what?
thanks
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't open privilege tables/mysql.sock

2005-07-11 Thread Tim Johnson
> > hmm! mysql.sock was created at var/lib/mysql. 
> > owner=mysql, permissions=777
> > So again, is there paths/permissions problems?
> > 
> >
> Since this is where your my.cnf says to put it, it would be a problem if 
> it was not there.
> If you are going to override the default location of the socket for the 
> server,
> you will also need to add an entry for the client.
> 
> [mysql]
> socket=/var/lib/mysql/mysql.sock

  ... of course ... 
  That's what I needed.
  
  (the my.cnf was copied from a RH 9.0 partition with
   mysql 3.23.58)
  
  Well done!
  thanks
  tim
  
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't open privilege tables/mysql.sock

2005-07-11 Thread Tim Johnson
* Gleb Paharenko <[EMAIL PROTECTED]> [050711 07:17]:
 
 Hello Gleb:
> Check that you have correct permissions set on MySQL datadir.
> See:
>   http://dev.mysql.com/doc/mysql/en/mysql-install-db.html
 
  I will add to the comments above. I had to set the owner
  and group to mysql as per my redhat setup.

  More problems tho:
  ==
  When invoking mysql, I get the following error message:
  """
  Can't connect to local MySQL server through socket at
  'var/lib/run/mysql/mysql.sock'
  """

  hmm! mysql.sock was created at var/lib/mysql. 
  owner=mysql, permissions=777
  So again, is there paths/permissions problems?
  The following is in /etc/my.cnf
  --
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
-
  
Thank you for your help so far. 
Further support greatly appeciated. :-)

Further pointers to docs invited!

Regards
Tim
> > Using 4.0.20 on Slack 10.0
> > 
> > New setup. mysql_install_db was run.
> > On startup, the error log shows the following error message:
> > """
> > Fatal error: Can't open privilege tables: Can't find file:
> > './mysql/host.frm' (errno: 13)
> > """
> > It would appear the paths are not being set. 
> > 
> > -
> > Need advice on what to do next. URLs of documentation would
> > be appreciated as well.
> > -
> > 
> > When I ran mysql_install_db, part of the message displayed
> > at that time was:
> > """
> > To start mysqld at boot time you have to copy support-files/mysql.server
> >  to the right place for your system
> > """
> > And I'm sorry to say, but I don't know what that means. 
> > 
> > Again, advice and clarification of these instructions are welcome.
> > Thanks
> > tim
> > 
> 
> 
> -- 
> For technical support contracts, goto https://order.mysql.com/?ref=ensita
> This email is sponsored by Ensita.NET http://www.ensita.net/
>__  ___ ___   __
>   /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
>  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
> /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
><___/   www.mysql.com
> 
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Can't open privilege tables

2005-07-10 Thread Tim Johnson
Using 4.0.20 on Slack 10.0

New setup. mysql_install_db was run.
On startup, the error log shows the following error message:
"""
Fatal error: Can't open privilege tables: Can't find file:
'./mysql/host.frm' (errno: 13)
"""
It would appear the paths are not being set. 

-
Need advice on what to do next. URLs of documentation would
be appreciated as well.
-

When I ran mysql_install_db, part of the message displayed
at that time was:
"""
To start mysqld at boot time you have to copy support-files/mysql.server
  to the right place for your system
"""
And I'm sorry to say, but I don't know what that means. 

Again, advice and clarification of these instructions are welcome.
Thanks
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Post-Installation Procedures for Slackware

2005-07-04 Thread Tim Johnson
* Gleb Paharenko <[EMAIL PROTECTED]> [050704 09:03]:
> Hello.
> 
> It depends on which distribution you've installed. General tips are
> contained in:
>   http://dev.mysql.com/doc/mysql/en/unix-post-installation.html
 
  Thanks. I have read that document. But I wasn't clear as to whether
  or not I should run mysql_install_db. Looks like I should, 'cuz
  slack doesn't use RPM.

  Cheers
  tim

> 4.0.20 is rather old, use the latest release (4.1.12).
> 
> 
> 
> Tim Johnson <[EMAIL PROTECTED]> wrote:
> > Hello All:
> > 
> > I am most familiar with mysql thru RH 9.0 and win XP.
> > I have set up a slackware partition (ver 10.0) with
> > mysql ver 4.0.20.
> > 
> > Are there any special instructions for Post-Installation Procedures?
> > 
> > thanks
> > tim
> > 
> 
> 
> -- 
> For technical support contracts, goto https://order.mysql.com/?ref=ensita
> This email is sponsored by Ensita.NET http://www.ensita.net/
>__  ___ ___   __
>   /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
>  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
> /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
><___/   www.mysql.com
> 
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Post-Installation Procedures for Slackware

2005-07-03 Thread Tim Johnson
Hello All:

I am most familiar with mysql thru RH 9.0 and win XP.
I have set up a slackware partition (ver 10.0) with
mysql ver 4.0.20.

Are there any special instructions for Post-Installation Procedures?

thanks
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysql.host: 3.23 to 4.0.2

2005-05-02 Thread Tim Johnson
I am current working with mysql 3.23 on Red Hat 9.0
in the process of moving to slackware 10.0 on same
machine, different partition. The version on the Slackwae
partition is 4.0.2*.

Question:
Will I be able to simply mysqldump my mysql database on
the RH 9.0 partion and then load the mysql DB on the Slackware
partition safely? 

What issues are there, if any? Pointers to docs, URLs
etc are appreciated.

Thanks
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Selecting with a list of keys

2005-02-23 Thread Tim Johnson
I would like to construct a query that searces on a variable list of  
primary keys.
Example: Lkeys = [12, 23, 15, 17]## python - style list of integers
Select column from table where ID in Lkeys;  ## mysql statement?

Is this possible, or does one have to generate a query for each key or 
generate
a query with multiple ORs?

This will have to be run on a *nix server with version prior to 4.0, I 
believe.
Solutions, comments and pointers to relevant documentation is all welcome.

Thanks
Tim Johnson
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


libmysqlclient.so.10 is needed

2004-09-20 Thread Tim Johnson
Hello:
Installing MySQL-server-4.0.21-0.i386.rpm
on Red Hat 9.0

Getting the following:
error: Failed dependencies:
libmysqlclient.so.10 is needed by (installed) MySQL-python-0.9.1-6
libmysqlclient.so.10 is needed by (installed) perl-DBD-MySQL-2.1021-3
libmysqlclient.so.10 is needed by (installed) php-mysql-4.2.2-17.2

I presume that I need other packages. What packages would that be?
thanks
tim
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Upgrading MySQL. Caveats or Cautions anyone?

2004-09-17 Thread Tim Johnson
Hello:
Am currently using Ver 11.18 Distrib 3.23.58
on Linux 2.4.20-20.9. (RH 9.0).

I'd like to upgrade to the current version. I would
like to know if there are any cautions to observe,
or any prepartory steps to take.

If I look at the following URL:
http://dev.mysql.com/downloads/mysql/4.0.html

I see some things that confuse me a bit:
I see this label:

Linux (x86, glibc-2.2, static, gcc)
## Well, I've got glibc-2.3

And I see this label:
Linux (x86, glibc-2.3, dynamic, Intel C++ Compiler)
## Well, glibc-2.3 looks good, *but* I don't have
## the Intel C++ Compiler. Just gcc (GCC) 3.2.2

Comments and pointers to docs would be appreciated.

Thanks much
tim
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



List of MySQL Keywords

2004-09-09 Thread Tim Johnson
Hello All:
I would like to make up a complete (if possible)
list of MySQL query keywords. I would appreciate
pointers to documentation that might hold such a list,
without too much extraneous or extra text.

In my current documentation, the Manual Function Index
is a good source, but if I could find something with
less "extra" text, that would be great.

TIA
tim
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Concatenating tables

2004-06-15 Thread Tim Johnson
* Frank Bax <[EMAIL PROTECTED]> [040615 12:59]:
> At 03:14 PM 6/15/04, Tim Johnson wrote:
> >We are importing data from 3 CSV files.
<..> >the 3 tables into 1.
> >
> >Taken as a sum, we should have about 330 columns
> >and 5000+ rows.
 
  Hi Frank:
> 
> Are you saying:
> each CSV contains about 110 columns for the same key values
  
   Yes.

> - or -
> each CSV contains 1700+ rows for the same 330 columns.
> - or -
> something else?
> 
> In the first case, I would consider loading three tables, then using sql to 
> "join" the data by key values and dump it into a new table with all 330 
> columns.  Then delete the three temp tables.
 
  :-)

> In the second case, I would concatenate the CSV files, then import them 
> into a table of 330 columns.
> 
> What performance penalty are you expecting with either of these scenarios?  
 
  I didn't anticipate any penalty myself (for scenario 1), but was
  looking for a second opinion.

  I like your tip on using "join". I always like mysql to do the 
  "heavy lifting" (they're so much better programmers than I)

  Thanks

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Concatenating tables

2004-06-15 Thread Tim Johnson
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [040615 12:11]:
> 
> Well, Tim, since you can't fix the data on the way out of the database (the
> original application), you will have to fix it on the way in.  My best
> advice is to create 3 new tables in MySQL that look just like your 3 raw
> data files.  Use a LOAD DATA INFILE command to populate each of your 3
> "raw" tables. That solves the problem of getting the data _into_ MySQL.
> Make all columns nullable on your raw import tables and do not create any
> indexes.  If you do not have names for your columns in your original data
> you can call them anything like "col001" just so that you have somewhere
> for your data to land.
> 
> The next problem will be to move it about in such a way that it fits into a
> useful data structure (especially into something with columns that have
> been usefully named).  It all depends on what you need to do with the data
> after import. :-(
 
  Thanks Shawn: I appreciate the input. 

  All these issues (populating tables, field names etc) are handled. 
  I'm sorry if I wasn't clear,  but my question really boils to to this:

  
  ** Will there be any perfomance penalties if we put all data into **
  **   ONE table?   **
  

  (I don't anticipate that there would be, but I'm asking for a non-list
   member, and will pass opinions on to him)

   Thanks again, I hope this reply clarifies.
   tj

> I am sorry but I don't know of any good resources to help beyond the MySQL
> manual and Google searches (search in both in the WEB and GROUPS areas).
> 
> Yours,
> Shawn Green
> Database Administrator
> Unimin Corporation - Spruce Pine
> 
> 
> 
> 
> 
>          
>
>   Tim Johnson
>
>   <[EMAIL PROTECTED]To:   [EMAIL PROTECTED]  
> 
>   .com>cc:   
>
>Fax to:   
>
>   06/15/2004 03:14 Subject:  Concatenating tables
>
>   PM 
>
>  
>
>  
>
> 
> 
> 
> 
> Hello mysql gurus:
> 
> We are importing data from 3 CSV files.
> Documentation regarding the originating
> database is for the most part, not available
> to us.
> 
> Translating directly from CSV to .sql files, we
> can see that the three files are really the
> first, second and third parts of one huge table
> and could be merged into one. This would simplify
> queries for us.
> 
> We realize that eventually, normalization should
> be applied, but for the interim, can we expect
> a performance penalty if we "concatenate" the
> the 3 tables into 1.
> 
> Taken as a sum, we should have about 330 columns
> and 5000+ rows.
> 
> Comments would be appreciated.
> Pointers to documentation on this subject
> are also quite welcome.
> 
> Thanks in Advance
> 
> Regards;
> --
> Tim Johnson <[EMAIL PROTECTED]>
>   http://www.alaska-internet-solutions.com
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 
> 
> 
> 

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Concatenating tables

2004-06-15 Thread Tim Johnson
Hello mysql gurus:

We are importing data from 3 CSV files. 
Documentation regarding the originating
database is for the most part, not available
to us.

Translating directly from CSV to .sql files, we
can see that the three files are really the
first, second and third parts of one huge table
and could be merged into one. This would simplify 
queries for us.

We realize that eventually, normalization should
be applied, but for the interim, can we expect
a performance penalty if we "concatenate" the
the 3 tables into 1.

Taken as a sum, we should have about 330 columns
and 5000+ rows.

Comments would be appreciated.
Pointers to documentation on this subject
are also quite welcome.

Thanks in Advance

Regards;
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: First letter only of a column

2004-04-13 Thread Tim Johnson
* Peter Lovatt <[EMAIL PROTECTED]> [040413 16:27]:
> Hi
> 
> select left(field, 1) from table where field = "something"
> 
> http://dev.mysql.com/doc/mysql/en/String_functions.html

* Kevin Carlson <[EMAIL PROTECTED]> [040413 16:27]:
> try this:
>
> select  LEFT(names, 1) from table

 Thanks folks.
 I love it!

 tim

<..> > another way of asking my questions would be,
> > Is it possible to truncate columns in selection
> > set to a specific length (in the case: 1)
> > 
> > Pointers to relevant documents are welcome.

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



First letter only of a column

2004-04-13 Thread Tim Johnson
Hello:
Is it possible to use mysql to select only
the first letter of a string in a column?
IOWS "select names from table" -> 
 "select  names from table"
another way of asking my questions would be,
Is it possible to truncate columns in selection
set to a specific length (in the case: 1)

Pointers to relevant documents are welcome.

Thanks
tim
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



MySQLCC - Garbage Display

2003-11-15 Thread Tim Johnson
Hello:
I'm using mysqlcc version 0.9.3 on RH 9.0.
When I upgraded from RH 7.2, the application seems
to have changed into a bizarre, unreadable font.

Does anyone know what could be the problem?
Obviously, this renders the application entirely
unusable. I suspect a QT problem, will look for
source and try to compile, if no other solution
offered.

Thanks
tim
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PHP or Perl? (or Rebol via TCP/IP)

2003-08-17 Thread Tim Johnson
> >
> > I hope I don't start a relegious war here I just want some advice.
> >
> >
> > Mark Healey
> > [EMAIL PROTECTED]

I program with C, C++, python and rebol. My partner use perl.
We do lots of stuff with MySql. My hands-down favorite is rebol.
I find more code-efficient than any other language that I have
used in my career. And it delivers sizzling performance from
mysql on a TCP/IP connection (rather than using shared binaries).

Like perl, rebol is easy to get off the ground with and there are
multiple ways to do anything. (including roll-your-own control
structures). given rebol's performance, I'm going to investigate
using C on a socket connection to MySql...

Just my thoughts 

My brother is a project engineer with motorola  they use
lots of both rebol and perl. Perl for regex and rebol for
socket work. Although I believe that you can harness regex
directly with mysql, I haven't done anything more than simple
blobs.
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com
  http://www.johnsons-web.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Problem renaming table

2003-08-14 Thread Tim Johnson
* Egor Egorov <[EMAIL PROTECTED]> [030814 03:49]:
> Tim Johnson <[EMAIL PROTECTED]> wrote:
> >I would like to rename a table if it exists.
> > 
> > The following query
> > IF EXISTS ALTER TABLE gwcc_members RENAME gwcc_members_bak;
> > fails.
> > 
> > also 
> > 
> > ALTER TABLE IF EXISTS gwcc_members RENAME gwcc_members_bak;
> > fails.
> > 
> > 
> > 1)What is the correct syntax?
> 
> You should check if table exists, and then rename table.

 :-) Igor, I appreciate the effort, but if you read above,
 I understand that logic but my poor attempt at syntax
 has failed :-(.

> > 2)Where is documentation.
> > I'm using ver. 3.23.41
> 
> Documentation is included in all MySQL distributions. You can also find online 
> documentation at:
>   http://www.mysql.com/documentation/index.html
 
   Thanks again, my friend, I am aware of the existence of the
   documentation, but it is very voluminous, if someone reading
   this could point me to something more specific, I would
   appreciate it greatly.
   Regards
   ~tj~
> 
> 
> -- 
> For technical support contracts, goto https://order.mysql.com/?ref=ensita
> This email is sponsored by Ensita.net http://www.ensita.net/
>__  ___ ___   __
>   /  |/  /_ __/ __/ __ \/ /Egor Egorov
>  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
> /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
><___/   www.mysql.com
> 
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com
  http://www.johnsons-web.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



  1   2   >