Re: getting table metadata
Try "DESC table_name". Yves Glodt пишет: On Friday 17 March 2006 15:52, Martijn Tonies wrote: Hello Yves, Hello Martijn, is it possible to get information about tables by doing queries on some system tables? I am using mysql version 4.1.11 on debian sarge. In my case I need to know which columns (names and types) a table has, and how the primary key is defined. How can I get this information out of mysql by only using sql ? Have a look at the SHOW commands in the documentation. I know about the "show create table ..." but it doesn't really satisfy my needs... Is there really no other way apart of parsing "create table" statements? (I needed to this with firebird, and found all I could dream of in the RDB$ tables) Best regards, Yves As for system tables, MySQL 4.1 hardly has any. Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Index and multiple fields
Hi, Mark! Of course, it depends on queries you are running. I beleive you can find all anwers here: http://dev.mysql.com/doc/refman/5.0/en/indexes.html http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html Markus Fischer пишет: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, is there, performance wise, any difference whether I create one index for multiple fields or each field with its own index? I'm running 4.0.16. thx, - - Markus -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEGnNH1nS0RcInK9ARAq9FAJ427uJXMuujd6Etnq7fhTSOqmISKgCg2Tn4 Qpytyz4PD4CPGSMEPX4ABbI= =cyqe -END PGP SIGNATURE- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: mysql.sock gone
Look at mysql's error log ($MYSQL_DATA_DIR/$HOSTNAME.err). Do you see anything strange there? Anton Krall wrote: No crons that would delete the tmp directory.. In fact, all the other files stay there... Just mysql.sock goes away... |-Original Message- |From: Logan, David (SST - Adelaide) [mailto:[EMAIL PROTECTED] |Sent: Tuesday, March 14, 2006 3:15 PM |To: Anton Krall; mysql@lists.mysql.com |Subject: RE: mysql.sock gone | |Do you have any cron jobs that clear the /tmp directory during the day? | |Regards | |--- |** _/ ** David Logan |*** _/ *** ITO Delivery Specialist - Database |*_/* Hewlett-Packard Australia Ltd |_/_/_/ _/_/_/ E-Mail: [EMAIL PROTECTED] | _/ _/ _/ _/ Desk: +618 8408 4273 | _/ _/ _/_/_/ Mobile: 0417 268 665 |*_/ ** |** _/ Postal: 148 Frome Street, | _/ ** Adelaide SA 5001 | Australia |invent |--- | |-Original Message- |From: Anton Krall [mailto:[EMAIL PROTECTED] |Sent: Wednesday, 15 March 2006 7:38 AM |To: mysql@lists.mysql.com |Subject: mysql.sock gone | |Guys. | |I just started having a problem, Im running |mysql-standard-4.1.12-pc-linux-gnu-i686 binaries under Fedora |Core 3 and Ive been having problem where during some parts of |the day, /tmp/mysql.oskc goes away, I can still see mysql |running when I do a ps ax but when I try to connect to it, it |says it cant connect thru mysql.sock | |What could be the cause that would make mysql.sock dissapear? | |Thx for any help you can provide | | |-- |MySQL General Mailing List |For list archives: http://lists.mysql.com/mysql |To unsubscribe: |http://lists.mysql.com/[EMAIL PROTECTED] | | |-- |MySQL General Mailing List |For list archives: http://lists.mysql.com/mysql |To unsubscribe: |http://lists.mysql.com/[EMAIL PROTECTED] | | | -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: missing mysqld.sock
Hi, Jon. mysqld.sock is a unix socket. mysqld creates it while starting and removes it when you stop the server. Jon Miller wrote: Is there a way to recreate the mysqld.sock file, it has gone missing from :/var/run/mysqld . Now MySQL will not run. Thanks Jon L. Miller, ASE, CNS, CLS, MCNE, CCNA Director/Sr Systems Consultant MMT Networks Pty Ltd http://www.mmtnetworks.com.au Resellers for: Novell Gold Partner, Cisco Partner, Peopletelecom, Westnet, Sophos Anti-Virus, CA Products "I don't know the key to success, but the key to failure is trying to please everybody." -Bill Cosby -- Regards, Eugene Kosov -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Permissions block database creation
User ''@'localhost' just hasn't enough privileges to create databases. http://dev.mysql.com/doc/refman/5.0/en/privilege-system.html Doug Pinkerton wrote: I'm a total newbie working through the tutorial in DuBois's _MySQL_. I've got MySQL running on my PowerBook. In Terminal, I can use the mysql client to get responses to things like SELECT NOW(). But the command CREATE DATABASE sampdb; results in the following error. ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'sampdb' mysql> I am unable to determine its location, which causes me to suspect that it is in the portion of the system not accessible from the Finder. Can anyone offer a suggestion? Mac OS 10.4.5 Thanks, dp -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: ~~Info needed~~
Hm... It seems to me In MySQL there's no such thing as "database owner". Or am I missing something? Mohammed Abdul Azeem пишет: Hi, How to check for the database owner for a particular database ? The way "show procedure status" command lists the "definer" column, Is there a command that shows the database owner. Similarly, what is the command to see the owner of a table in a database ? Thanks in advance, Abdul. This email has been Scanned for Viruses! www.newbreak.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Select IP from Text Type
Hi, Ron. I think REGEXP can help you.. http://dev.mysql.com/doc/refman/5.0/en/regexp.html Im trying to select an IP from a TEXT (details) type field, which works if I do this: select id from `table` where `details` like '%192.168.0.1%' : But If I want any record with an IP in that TEXT type field it seems a little tricky. I have tried: select id from `table` where INET_ATON(details) BETWEEN INET_ATON('127.0.0.1') and INET_ATON('192.168.0.2'); select id from `table` where INET_ATON(details) BETWEEN INET_ATON('%127.0.0.1%') and INET_ATON('%192.168.0.2%'); select id from `table` where details BETWEEN INET_ATON('%127.0.0.1%') and INET_ATON('%192.168.0.2%'); For instance I know this IP (192.168.0.1) is in 14 different records, what I was hoping for is a result like so doing a wildcard search for any IP in this text field. +--+ | id | +--+ | 66 | | 148 | etc.. 14 rows in set (0.01 sec) Any other ideas on how I could do this? Ron -- Regards, Eugene Kosov -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: selecting records newer than say 20 min
Hi, Gregory Hmm.. I think you just should add something like 'create_time > DATE_SUB(NOW(), INTERVAL 20 MINUTE)' to a where clause of your query. Or something similar.. You can find more at http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html. Also consider creating of an index on your timestamp field, if your table is large. Hi What, is the easest way to select all the records created in the last 20 min stay based on a column that has a timestamp record. Many Thanks -- Gregory Machin [EMAIL PROTECTED] [EMAIL PROTECTED] www.linuxpro.co.za www.exponent.co.za Web Hosting Solutions Scalable Linux Solutions www.iberry.info (support and admin) +27 72 524 8096 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: offset or skip_count
Hi, Rich. What is skip_count? I couldn't find any reference to it in mysql documentation. I'm not sure I understood your question, but I beleive you're asking for LIMIT modifier. SELECT * FROM $table LIMIT $offset, $record_count; or SELECT * FROM $table LIMIT $record_count OFFSET offset; Hi folks. I'm wanting to provide some safety for a search. I'll be grabbing about 45 fields, and perhaps thousands of records, so that I can build an xml file using my middleware. How can I structure an SQL statement so that I can jump through records 100 at a time? Do I use offset or skip_count? Cheers Regards, Eugene Kosov. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Quoted DB name in USE statement.
Hi, List! First of all, what does mean 'log' suffix in version name of MySQL server? I have some problems with MySQL server 4.0.25-log (Don't say that I should update it. I don't have such privileges, so I have to deal with it). Server doesn't understand quoted DB names in USE statement. mysql> USE `mysql`; ERROR 1049: Unknown database '`mysql`' I couldn't find something similar at bugs.mysql.com. Can anyone suggest some workaround? Removing -Q while making a dump isn't a way.. I am moving other users' tables where can be a lot of "bad" field and table names. Thanks in advance! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]