I have a database in server it has some MyISAM tables and many InnoDB tables If I look through phpMyAdmin its

but the try/except it supposed to catch that i think..

/usr/local/mysql/bin/mysql

`which mysql` could help

how which
i compile 5.0.41
i compile host 5.0.41
what to write then path to mysql shared libraries directory?

is it an autoincrement issue? doesn't look like you're inserting a primary key

i dont have an autoincrement. the 'groupname' is the key

oh, hm, and an exception is being thrown?

ihaaaaaaaaaa
it work

congrats

sandrot, from where are you ?

US

sandrot, thanks man
SP

ok im totally retarded
nevermind
i had "show exceptions" checked , so when it popped up the exception, i thought it was erroring out..

glad he irc helped kickstart your brain

it was doing exactly what it was supposed to do

=]

well, at least i know im not losing my mind.. that was working fine yesterday!

sandrot, what is the new version of mysql

I don't know ubuntuserver

ok

can you give a full query an alias or variable or something?

Is there any way to do a 'select into outfile' from the command line that outputs to STDOUT? That is, write a query that outputs CSV

will mysqladmin do it?

That's kinda why I'm asking :-D
I can't see anything in the help that will do it
mysqldump is more likely, but I can't see the useful options

you may not get a csv out of the box but if you organize the dump excel or something could generate the csv for you.

excel? I don't think mysql is gonna do excel if I can't get it to do CSV
I think I found what I need in mysqldump
heh .. it just a select into outfile internally
Unfortunately it won't do it to stdout coz it needs –tab

I meant you could take the contents of the dump and import it into excel, then have excel create a csv out of the contens
Hmm

that would be the craziest way to do it :-D
It would be much saner to just SELECT in perl and just output to STDOUT

thought you wanted csv specifically…

yes .. perl is quite able to output to CSV ..

yeah, guess it could be easy to do with perl
nice

much better than having to manually phart around with excel!

fuck yeaH!

I have a database in server, it has some MyISAM tables and many InnoDB tables. If I look through, phpMyAdmin it's size is more than 28MB. But when I check database file size with command "du /var/lib/mysql/databasename", it shows 448kb. How this is possible?
I just came to know this by copying directory to localhost for backup.
and check it through localhost phpMYAdmin

the whole directory is 448kb?

yes

hmm, yeah you're right…

and in localhost phpmyadmin, I see only all tables, but does not have records.
?

I dunno, records have to be stored somewhere else, but I thought the MYI stored all the info

no, in the downloaded directory, for many tables, there is no MYI files, only FRM files are there.

hey

and all these FRM are InnoDB too.

what about /var/lib/mysql/ibdata# ?

has anybody here used the Google patch for replication?

not familiar with it

mmm

1 min

It makes sure that the slave never falls behind

nice

ibdata1 = 171MB

by not commiting any changes until the slave has received them
wondering how well it works o_O

ib_logfile0 and ib_logfile1 = 5.1 M
I do not know what is happening.
But once commented all setting related to innodb in mysql configuration file, I get the database host and tables as it is in server.
Anyhow, thank a lot for response.
bye

see ya

http://rafb.net/p/IAlHxe91.html
Is that possible with a SELECT query?
Hello btw (

what's the problem?

I have a table with fields and their values and one table containing the fields for a particular type.
type, fieldname, fieldvalue.
I can do SELECT fieldname, fieldvalue FROM mytable WHERE type = 0 to get the fields for each item in the table which has type set to 0
Though, I'd like to get one row for each item of type 0 and turn the table 90 degrees so that the values of column fieldname end up being the name for the columns
as my little drawing shows

what's the second table schema like?

Something called PIVOT tables they said in #sql, but I didn't really understand any of the stuff I found on google
I know what JOIN is and that's not what I want here.
I want to turn the table 90 degrees clockwise so that the left most column turns into table header
and the right column becomes the first row

does anyone know of a proper way to input zip codes into a mysql database? the table itself
I want to input it into a table called users i want to make a field for zip codes

Almost certainly, you want a varchar- even if it seems like you want a int or decimal

Im thinking i might need a int

Remember that post codes do not necessarily follow the same format in countries outside the usa

I'm trying to setup the table the correct way So i do not run into problems later

Varchar is best, e.g. Swedish zip codes are 60351 inside sweden, but S-60351 from outside.

im going to end up making a radious and proximity search

I don't know what the structure of a USA zip code is, but I strongly recommend a varchar

alrighty, even tho char is faster?

As far as I know, you'd have to store lat/long to do a radius search

Mark is there a pasty site that this channel uses?

char is not "faster". Benchmark them to see which is faster if you're terribly concerned about performance.

dpaste.org is nice

varchar is potentially faster if your server is I/O bound and most of the rows contain only a short string
The only way of determining what is "faster" is to benchmark your application with real data

yes
dpaste.org is down

pastebin.ca

http://dpaste.com/14919/
I need to do it in the users table
Because I need to make it so when they do the search it gets people in there area

their

thar

If you're expecting a significant number of users, and you want to search by zip, I'd suggest you might want to index the zip column too ..

how would I accomplish that?

(also, if you're international consider just a free-text 'name' as some cultures don't have the same concept of a first and last name)

hang on here is how I was planning on accomplishing this tell me if I'm doing this the wrong way
I was going to go ahead and have all of the peoples zip codes stored in there user section

THEIR

then get all of the information for longitude and latitude and make a new table called zip codes
have the script take the searching zip code use the info inside of the zip code database then print the users profiles because it knows there zip codes
Is this the wrong way to accomplish this?

sounds about right to me .. though are you planning on calculating the GSD to every other zip on-the-fly?

I'm trying to a SELECT a from `table` where LOWER(a) = LOWER(b) but this doesn't work. is there some other way to do this?

Why do you need to use LOWER() ? Why not just use a collation which is case insensitive (these are used by default in most installations anyway)

woosta I'm going to have the Users zip codes stored in the users table, have the data with long and lat stored inside of the zip codes database so it would do it fast

No, it wouldn't

I'm probaly going to end up even caching the zip codes searches too so it doesnt need to calculate instantly

I don't know how many zip codes there are in the USA, but you're going to have to calculate the GSD for every one of them on every request

not a bad idea, but at other times this table needs to be case insensitive.. is there a way to force the collation for the duration of the comparison?
(rather, case sensitive!)

Woosta, I dont just have usa

Then you MUST cache it

I have canada, all of uk australia and many more

However, I wouldn't bother

I believe there is, but you will lose the ability to use indexes if you do this. Normally if you use = to join two indexed columns, this is a good thing

Just have a table of 'close' postal codes

the tables are small, it's ok

You'll find that due to our government's idiotic information policy, getting location data for postcodes will cost you money
(I mean here in the UK)

I already have them :-p

You can calculate the GCD just once then for every postalcode-pair, and store the closest N

fresh from 1 month ago

What, all of them?

yes

I assume you paid money, it is NOT free

I know the owner of a data company

the information is 'out there' ..

It is out of date and potentially wrong however

sure

he paid
I didnt
:-p

All because our government is too stupid to see the public interest of making it free
Curiously, in the USA this info is free

lol

is it?

so should i use varchar with int? or just varchar

In our country, healthcare is free but post code geocoding data costs money
varchar.

ok

Why an int?
jsut a varchar

I can't see Moore making a film about the geocoding data though

And as I said, you DO NOT want to calculate the GCD in real time, ever

mhm, what is the benefits to using char then?
Curiosity guys
I'm learning =p

It can store post codes for countries other than the USA

alrighty
how many characters?
do you think

Erm
Don't you have the data already?

i dont know how many uk has
its on my laptop
lol

So .. have a look there
Pointless asking us

grr now i have to get up and get it haha

As far as I'm aware, the longest uk postcode is 7 chars, but don't count on it

We know databases, but can't really tell you much about international postal codes

well one of you all said you are from uk
ill go safe with 15
varchar(15)

If anyone can help with this, please do. I'm at a complete loss.
MySQL won't start. InnoDB just gives out an error … let me get it
It tries to process the binlog, one that doesn't exist and is removed from the index.
Error: tried to read 16384 bytes at offset 0 770048
Was only able to read 8192
Error Number 22 means 'Invalid Argument'
read
Cannot continue operation

Are you sure it's trying to process the binlog, not its own log files?

It tries to open a non-existant binlog then errors.
So I made a backup of the ib_logfile's and deleted the original to try again.
But it's just odd … it's trying to open a non-existant binlog.

If you don't want to recover the server from a backup and it's not a replication master, you can safely remove (or move) all the binlogs and their index file. php mysql web hosting will start again from 1.
Be very careful what you do to a production system however
(obviously)

We did remove the binlogs.
It's still trying to open them for some reason, even tho they aren't there.
This time I got a I/O error after it said it was trying to read from log-bin.000008
Hey … question.
ib_arch_log_000000000000 what's in there?
I just tried copying it to my backup, and the disk gave me an I/O error

If your disc is giving I/O errors, you have other problems.

Oh I know.
I'm trying to get shit off this drive, but I need MySQL up to do it.
Can I safely try and delete the ib_arch_log file?

If your hard drive has failed, you may as well restore from a backup
I don't know.

The drive isn't failed, yet.

My servers never seem to have one of those. We use 4.1

Ah

If it's giving IO error, the drive *has* failed

Yeah, backups on this box are very hard to make. Something about 2.5 million tables.
It's just this one file.

2.5M tables sounds like too many to me

So it's that part of the drive.

hey guys Im going to do one more pasty really fast

And yet I can delete it.

if you go to http://puqs.com/install.php if you go here http://dpaste.com/14920/ that is my code I'm trying to make it force into the database
there is an error on the last line am I closing it wrong?

Don't use PHP short tags
Does your user have permission to create tables? WHat happens if you execute the same command from the mysql client?
Are there some quotes missing in that script?

if i drop the table in phpmyadmin it works
but I cant get it to run this way

Stuff phpmyadmin - use the mysql command line client
It looks like there should be a quote on line 16

how do i make it work without using any client
just the server

Use the mysql command line client to test queries in your development environment. Don't use phpmyadmin for anything, it's made by idiots

") ENGINE=MyISAM;" ?
=[ I'm still learning just started today figured the best way to learn is to take my time and learn as I go along
been reading tutorials and such
Mark, the query works
It's getting the php hosting to drop the files in the database
that is not working i have all permissions set on the database

hellas
i have installed the xampp package and would like to install a forum
but it cant find the php mysql web hosting server

not found"

This is a mysql channel, sounds like you're using some strange bundled package. Consult the winmysqladmin support people or xampp.

ya
ok

line 42
better yet…
supplied argument is not a valid MySQL result resource in /home/made/public_html/www/doc-root/flipcide23/index.php on line 42

This is a PHP problem, you have failed to correctly call mysql_query, or not checked its return value. Probably there is a problem with your query.

thanks

hi everyone!
when I've got a 'enum' field, can I order per value? so like: order by enumfield = "open", enumfield="close", … ?

insert ignore
does that mean disregard errors
ignore insert errors?

I believe it only applies to duplicate key errors

cool thats what i want
second question. structure question

Other types of error will still be reported

i have a product inventory table

it means you have to read mysql.com/insert

i want to add a feature to TRACK the old prices of products (when doing a big database update)
so the way i'm planning it is. a second table. old_prices
ProductID,Price

You would surely need to have a date/time of when the price was current from / to

nah. i'm only tracking the last price
just so i can show on the product page Up $22 or .. Down 13$
anyway the dilemna is… how do i set the change to Zero.. if the price is the same?
Inventory (current invent) and… NewInventory (latest inventory & prices)
all i do is update inventory,newinventory set i.price = new.price where i.code = n.code
wait i think i got it

Why not put it in another column in the same table?

i dont like too many columns in one table

Prefer new columns to new tables, mostly.

and because that would destroy a million other things in the database host update system

Why?

cause of the way my system is built thast all
update inventory i,newinvent n,pricehistory h set h.price = i.price where i.price != n.price and i.code = n.code and n.code = h.code
hows that

I'd just do two updates
But again, I'd put it in a column

nah man
you heard of Normalization?

Yes I have. Having several columns does not violate normal form.

sure it does
dude
you can't denyyyy. that PriceHistory should be a table
look at the name. it screams tablify me

If you only want to store one historic price per product, you may as well put it in the product table.
If you need several, you need another table.

nah. just pretend that i want to store date & other prices
ok you win in that regard i geuss
but ill still make a second table cause one table is 2 much
work

If you're storing it so you can display "was £5 now only £4", then you only need one
One table

yeah i know
i knwo this
but i have to do 2 tables
anyway a table JOIN isn't that slow is it

A table join isn't generally that bad, it depends on a lot of factors however

ah yep

someone how knows how to sort on multiple enum values? like: order by enumfield ="open", enumfield = "other" ?
didn't try this, but is that possible?

roxlu, itis

grouped by location. Whats the best way to do this?

ORDER BY created, location doesn't work like I want. and neither will location, created
Is this a programming issue or can it be solved with a query?

group by and order by

SELECT * FROM `job_listing` GROUP BY `location` ORDER BY `created` desc LIMIT 5 ?
doesn't seem to work properly
Anyone?

so customize it to your needs

and when you remove the quotes?
ah..

What?
The quotes dont matter

god damnit

How int he world can I repair an innodb table?
Incorrect key file for table 'table'; try to repair it

sorry ’bout that one :P

Hi
Whats wrong with this syntax? INSERT INTO packages (name, major, manor, release) VALUES ('error-0.1.0.zip','0','1','0');
bWhats wrong with this syntax? INSERT INTO packages (name, major, manor, release) VALUES ('error-0.1.0.zip','0','1','0');/b

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Comments are closed.


Blog Tags:

Similar posts: