Can't drop database that shows up in show databases

2008-03-08 Thread Waynn Lue
SHOW DATABASES; shows that I have a database called test, but when I
call DROP DATABASE test, I get

ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist

When I run any queries on that database, I get errors like:

mysql select * from Users;
ERROR 1017 (HY000): Can't find file: './test/Users.frm' (errno: 13)

My previous solution of deleting the ./test folder worked only
temporarily, but restarting mysqld seemed to recreate it.  Anyone have
ideas on how to drop this database?

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



Re: DBDesigner 4 and MySQL

2008-03-08 Thread arman
look at this:

http://forums.mysql.com/read.php?113,27031,39226#msg-39226


-- 

arman p.
Sinapsis Peru
http://www.sinapsisperu.com
http://armandfp.blogspot.com/


Re: Can't drop database that shows up in show databases

2008-03-08 Thread Martin Gainty
Waynn-

does the OS user you use to execute mysql have create/write/read/execute
rights to the ./test folder?

Martin-
- Original Message -
From: Waynn Lue [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Saturday, March 08, 2008 6:58 AM
Subject: Can't drop database that shows up in show databases


 SHOW DATABASES; shows that I have a database called test, but when I
 call DROP DATABASE test, I get

 ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist

 When I run any queries on that database, I get errors like:

 mysql select * from Users;
 ERROR 1017 (HY000): Can't find file: './test/Users.frm' (errno: 13)

 My previous solution of deleting the ./test folder worked only
 temporarily, but restarting mysqld seemed to recreate it.  Anyone have
 ideas on how to drop this database?

 --
 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: Can't drop database that shows up in show databases

2008-03-08 Thread Craig Huffstetler
Waynn:

What user are you using to execute mysql from the command line? Perhaps run
mysql (from command line) as root then execute the desired actions (such as
drop). This will make sure you can drop the table and avoid any further
problems.

Sincerely,

Craig Huffstetler

On Sat, Mar 8, 2008 at 6:58 AM, Waynn Lue [EMAIL PROTECTED] wrote:

 SHOW DATABASES; shows that I have a database called test, but when I
 call DROP DATABASE test, I get

 ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist

 When I run any queries on that database, I get errors like:

 mysql select * from Users;
 ERROR 1017 (HY000): Can't find file: './test/Users.frm' (errno: 13)

 My previous solution of deleting the ./test folder worked only
 temporarily, but restarting mysqld seemed to recreate it.  Anyone have
 ideas on how to drop this database?

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




Re: Can't drop database that shows up in show databases

2008-03-08 Thread Baron Schwartz
Hi,

On Sat, Mar 8, 2008 at 6:58 AM, Waynn Lue [EMAIL PROTECTED] wrote:
 SHOW DATABASES; shows that I have a database called test, but when I
  call DROP DATABASE test, I get

  ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist

  When I run any queries on that database, I get errors like:

  mysql select * from Users;
  ERROR 1017 (HY000): Can't find file: './test/Users.frm' (errno: 13)

Whenever you see errno: X, run perror and see what the error is:

[EMAIL PROTECTED]:~$ perror 13
OS error code  13:  Permission denied

That is why other posters are suggesting it might be a permissions
problem.  It sounds to me like there might be an InnoDB problem mixed
in with this: did you delete any .frm files (or databases) from the
filesystem without first dropping the InnoDB files that use them?
InnoDB will complain about this if you did.


  My previous solution of deleting the ./test folder worked only
  temporarily, but restarting mysqld seemed to recreate it.  Anyone have
  ideas on how to drop this database?

  --
  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: Can't drop database that shows up in show databases

2008-03-08 Thread Waynn Lue
This problem actually started after I moved the datadir to another
folder, so that's quite possible. We stopped everything, rsynced the
folders over, then restarted mysql. But I do notice a permissions
problem, since the owner currently is root. I'll chown it to mysql
then see what happens.

I'll post back with results.

Thanks for all the advice,
Waynn



On 3/8/08, Baron Schwartz [EMAIL PROTECTED] wrote:
 Hi,

 On Sat, Mar 8, 2008 at 6:58 AM, Waynn Lue [EMAIL PROTECTED] wrote:
  SHOW DATABASES; shows that I have a database called test, but when I
   call DROP DATABASE test, I get
 
   ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist
 
   When I run any queries on that database, I get errors like:
 
   mysql select * from Users;
   ERROR 1017 (HY000): Can't find file: './test/Users.frm' (errno: 13)

 Whenever you see errno: X, run perror and see what the error is:

 [EMAIL PROTECTED]:~$ perror 13
 OS error code  13:  Permission denied

 That is why other posters are suggesting it might be a permissions
 problem.  It sounds to me like there might be an InnoDB problem mixed
 in with this: did you delete any .frm files (or databases) from the
 filesystem without first dropping the InnoDB files that use them?
 InnoDB will complain about this if you did.

 
   My previous solution of deleting the ./test folder worked only
   temporarily, but restarting mysqld seemed to recreate it.  Anyone have
   ideas on how to drop this database?
 
   --
   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]



Regular Expressions in MySQL -- how to show addresses that have the same numbers?

2008-03-08 Thread Joshua Beall

Hi All,

We've got a database (legacy, running MySQL 4.1.22 Standard) of
constituents.  We want to search through it for duplicates, and I've found
that a good way to generate a list of potential duplicate addresses is to
look for addresses that have matching street numbers, zipcodes, and last
names.  For instance, consider the following two records:

John Smith, 123 E Easy St, Springfield, IL 12345
John Smith, 123 East Easy Street, Springfield, IL 12345

They're not a letter for letter match, but if you just compare the last
names (smith), and the numeric components of the address (123 and
12345), they would match.

I am wondering, is there a way to search through a table like this (all
fields are varchar):
fname, lname, address, city, state, zip

Using regular expressions, to show any records which match another record on
lastname, street number, and zip?  I could do this easily enough in a client
language like PHP, C#, Java, etc., but I was hoping I could do it in SQL
directly.  Is this possible?

If it's possible, but only with MySQL 5 or better, I could probably export
the database, and import it into a newer version of MySQL.  But it would
naturally be nicest if we can do on the existing server.

Suggestions?

  -Josh
-- 
View this message in context: 
http://www.nabble.com/Regular-Expressions-in-MySQLhow-to-show-addresses-that-have-the-same-numbers--tp15923015p15923015.html
Sent from the MySQL - General mailing list archive at Nabble.com.


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



Re: Comma's in data?

2008-03-08 Thread obed
Use \ to escape.

mysql insert into table1 values ('algo\,otra');
Query OK, 1 row affected (0.00 sec)

mysql select * from table1;
+---+
| a |
+---+
| algo  |
| algo,otra |
+---+
2 rows in set (0.00 sec)


On Sat, Mar 8, 2008 at 1:52 AM, J. Todd Slack
[EMAIL PROTECTED] wrote:
 Hi All,

  I have a client that wants to insert data into a VarChar field that contains
  commas. These are property addresses.

  Example:
  2966 Moorpark Ave, San Jose, CA, 95128

  1 Infinite Loop, Cupertino, CA, 95

  How can I allow this?

  Thanks!
  -Jason




-- 

obed.org.mx

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



Re: Comma's in data?

2008-03-08 Thread Kevin Hunter
At 12:23a -0500 on Sat, 08 Mar 2008, obed wrote:
 Use \ to escape.
 
 mysql insert into table1 values ('algo\,otra');

As an aside, I'm curious why the parser doesn't understand that the
comma is part of the string in this context?  It's already between two
single quotes ... ?  Shouldn't that be enough?

Kevin

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



Re: Comma's in data?

2008-03-08 Thread Steve Edberg

At 11:52 PM -0800 3/7/08, J. Todd Slack wrote:

Hi All,

I have a client that wants to insert data into a VarChar field that contains
commas. These are property addresses.

Example:
2966 Moorpark Ave, San Jose, CA, 95128

1 Infinite Loop, Cupertino, CA, 95

How can I allow this?

Thanks!
-Jason



I've never had to escape commas; only special characters, eg: '_%. 
MySQL seems to ignore escaping if the following character is not 
special, though:




[EMAIL PROTECTED] create table test (t1 varchar(255));
Query OK, 0 rows affected (0.03 sec)

[EMAIL PROTECTED] insert into test values ('qwert'), 
('qwe,rt'),('qwe\,rt');

Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

[EMAIL PROTECTED] select * from test;
++
| t1 |
++
| qwert  |
| qwe,rt |
| qwe,rt |
++
3 rows in set (0.00 sec)



Are you getting an error when you insert a row? If so, what is the 
error? Perhaps you are having a character set issue. This is what 
mine looks like:




[EMAIL PROTECTED] show variables like 'character\_set\_%';
+--++
| Variable_name| Value  |
+--++
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database   | latin1 |
| character_set_results| latin1 |
| character_set_server | latin1 |
| character_set_system | utf8   |
+--++
6 rows in set (0.00 sec)


steve


--
+--- my people are the people of the dessert, ---+
| Steve Edberghttp://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center[EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin (530)754-9127 |
+ said t e lawrence, picking up his fork +

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



mysqldump on specific columns only?

2008-03-08 Thread Waynn Lue
I'm trying to dump all the columns of a table but one in a
restructuring of my schema.  I found this post:
http://www.jsw4.net/info/listserv_archives/mysql/05-wk49/msg00131.html
which seems to indicate that this isn't possible, but I was wondering
if anyone had any suggestions.  My current solution is to do a simple
search and replace, but that won't work for everything.  I could
always do regex search/replace, as well, but I'm hoping for something
native to mysqldump, since the files are going to be rather big.

Thanks,
Waynn

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