Access denied for user root@localhost using password NO Ive been working on this problem for a day straight and

SELECT bleh FROM table ORDER BY id DESC LIMIT 10

thank you Jester-|

(provided id is auto_incr

which indeed it is

oldset to latest

you guys connected in any way?

come to our sekret channel!
we need ou

now, let's say i wanted 50 items available, but wanted to display only 10 at a time..?

err, u would need to do

whats the difference between ALTER and UPDATE?

SELECT bleh FROM table ORDER BY id DESC LIMIT 10, 20
then second query

!man alter table

see http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

!man update

SELECT bleh FROM table ORDER BY id DESC LIMIT10, 30

see http://dev.mysql.com/doc/refman/5.0/en/update.html

and so on

Jester-|: did you have the order wrong

what order

limit

i dont understand what ur on about

Jester-| limit 10,20 or limit 20,10

its AMOUNT,OFFEST no ?
OFFSET **
!man limit

see http://dev.mysql.com/doc/refman/5.0/en/information-functions.html

my bad, got it wrong way round lol
sorry uploink its LIMIT STARTING_POINT,HOW_MANY_ROWS_TO_DISPLAY

Jester-|: thanks^^ i think i understand LIMIT now

careful with the use of LIMIT, it still needs to fetch all the rows you skipped, and with ORDER BY it still need to read all those rows and try to sort to get what you need in the LIMIT
don;t overdo it

so limit may not always be the most efficient way to do things?

thats right

Hello

anyone here use phpMyEdit - i'm trying to color code a cell depending on the content… i've been through the docs for an hour now, and i just can't figure it out - any assistance is greatly appreciated :-)

anyone here use phpMyEdit - i'm trying to color code a cell depending on the content… i've been through the docs for an hour now, and i just can't figure it out - any assistance is greatly appreciated :-)
(oops!)

is there such a feature? i do not use it

what is phpmyedit, and this is prolly a question for them or over in ##php

does anyone know a mysql function that sets the first char to uppercase?

!m Techdeck_ string functions

Techdeck_ see http://dev.mysql.com/doc/refman/5.0/en/string-functions.html

mysql.com is down

play around with multiple functions

sweet

:P

hope you have an offline manual

lol
someone must know

upper()
left()

heh

concat()

upper set the whole thing
what does left do?

substring() maybe

gets you first char

whoa
isn't there an easy way?

there is no titlecase function

aww
thanks man

first char each word is even more complicated

how about you do that before you insert the data?

good idea :p

and apply the same function on the inserted value, or an insert trigger

hi
I'm getting a strange php mysql web hosting error and I'd like to ask you for help..
I have two queries, the one is SELECT, the other is UPDATE
I connect to the database with a unique user that has privileges only for its own database (CRUD, grant)

is it possible to add a TIME to a DATETIME?
0 = 2007-08-16

but the mysql ends on the UPDATE query with an error message "There is no 'root'@'%' registered"

+ interval

please tell me i can rollback the database………………

has anyone here heard of Aeron chairs?

the queries are executed right after each other
in the same way..

what is the exact error message

There is no 'root'@'%' registered

is that a mysql error or your application error

mysql error
it's the output of echo $mysqli-error;

any special number of codes?
or

0', interval 1
args inteval 1 hour of course

kimseong, 1449

datetime + interval hour(time) hour + interval minute(time) minute + …. you get the idea

anyone know how to rollback changes to a table in the database mysql.com is down cant look it up

not sure if there is any shortcut
!m laurly rollback

laurly see http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-transactions.html

its down

!m laurly rollback transaction

Sorry - I have no idea what function you're talking about! but try http://dev.mysql.com/rollback transaction

!m laurly transactions

laurly see http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-transactions.html

yes, we're working on getting *.mysql.com up.. sorry for inconvenience.. etc ..etc

rollback;

kk, thanks miracee, kimseong , I'm checking if it's easier with date_add, if not I will follow kimseong's approach

yes, we're working on getting *.mysql.com up.. sorry for inconvenience.. etc ..etc

rollback isnt just says theres nothing

damn lag

deleted from the wrong table :/

restore from backup

yeah last back up was 4 days ago :/

for some reason mysql documentation website doesnt open

binary logs on?

any problem? roll forward with binary log

is anyone experiencing the same?: http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html

binary logs?

do you have offline manual? the website is down

yes, ther are some connectivity problems right now

Hi .. can somebody tell me please if there is a function in mysql like the php strip_tags to remove HTML - Tags ??? THX :-)

kimseong, nope , I will access it through google's cache

*.mysql.com down, we're working on it
etc etc

ping!

pong

mysql.com is working for me

*.mysql.com is back online
\o/
and I thought I would have a day off, damn it :P

mysql_explot_server_boom_the_world hello

..I have no idea why it's trying to connect to this remote root user when the connection is defined properly to another user and all previous queries work fine.. plus it's out of a blue

hi … can somebody please tell me if there is a function in mysql which removes html tags ??? THX :- )

wishful thinking! :-)

was HOUR_SECOND function added in earlier versions than mysql 5.0.38 ?
select hour_second(now()) fails

select concat(hour(now()),':',second(now()))

sorry, I meant to say later versions
hehe, kimseong, well I thought date_add was easier than extracting hour, minute, second from my TIME field

that would be too much unexpected freetime and you have to think about house cleaning and stuff like this

What indexes do I need for this query:
SELECT u.id FROM users u LEFT JOIN posts_users pu ON (pu.user_id = u.id) LEFT JOIN posts p ON (p.id = pu.post_id AND p.deleted=0 AND p.new = 1) WHERE u.deleted = 0 AND u.installed = 1 AND (p.id IS NOT NULL OR u.last_update_md5=\"\") GROUP BY u.id ORDER BY u.id ASC
bSELECT u.id FROM users u LEFT JOIN posts_users pu ON (pu.user_id = u.id) LEFT JOIN posts p ON (p.id = pu.post_id AND p.deleted=0 AND p.new = 1) WHERE u.deleted = 0 AND u.installed = 1 AND (p.id IS NOT NULL OR u.last_update_md5=\"\") GROUP BY u.id ORDER BY u.id ASC/b

what would you expect to be good indexes?

lol laurly

Well, obviously the id colums are primary, the user_id and post_id are indexed.

OH my god, our art director is insanely good…

But I thought perhaps composite indexes would be better…
But not sure which ones to do.

hmm good. what is the cardinality of the other attributes you want to index?
what says explain?

no need to put 'customer' on this channel :P
or network
shinguz

I would never expect oli behind the nick shinguz

better?
NEVER?
:-D

well, I'm not your boss of course :P

I realy doubt, that my boss is in this channel…

see private message
i'm the activing boss of support \o/
acting
damn big fingers

irc work again

helo

$x = mysql_fetch_array($result); –how can i fetch in a way so i get no array but just the value?
the result is a number - a result of count(*)

!MyISAM

!man fetch

see http://dev.mysql.com/doc/refman/5.0/en/fetch.html

robboplus, dont worry about it 99.9999% of the time you will want fetch_array

archivist do i really need to?
then i need to write a code to convert that to a string
and that's a little "dummy" code
there is no array, really, just a single count(*) result which will be a digit 1-9
no better way of fetching that into a $string?

get uesed to the fact that its a return that may have many results

but this one will not have many
or is it possible that in some cases count(*) will return more than one result?

nobody is going to break the syntax for idle programmers

i don't understand you
why fetch an array when it's NOT an array and just a single value

yes if it includes a group by and other fields

and why process that "array" and waste cpu?
and time
anyway i follow you and i give up - will add those few lines just to grab my "5" or "1"

how can I update a field to its default?
is this possible? google doesn't seem to have an answer

query the db for the defaults and update the record, first time Ive seen a request to do that

hmmm setting to NULL should do it, but testing this doen't seemt to be working?
archivist, I want to reset a field to its default
ah no setting to NULL will make it 'default value appropriate for the data type', which is 0 for numeric types

Hey, if I have a table with a composite primary key (post_id, user_id), will it be worth creating a one-column index for user_id to speed up DELETE FROM table WHERE user_id = 123456?

can I set a field to it default value?

saul11, I just told you a way

how can I find the default of a column?

how can i ask mysql about two different count(*) within same connection to the db?

Hi, what is sql command for current month as 08…

so it gets stored in a single array
!man date

see http://dev.mysql.com/doc/refman/5.0/en/using-date.html

saul11, show create table tablename, or look in information schema

how can i update a number of fields in a query rather than just setting the value of one?

!man update

see http://dev.mysql.com/doc/refman/5.0/en/update.html

all the syntax is there

how do i run two queries within same connection to the db? i tried $query1 and $query2 but it doesn't work
i would like to connect, fetch like 1-3 things and close connection, then process those results
works for single fetch and i can't understand how to do that for multiple queries

hi, does anyone know a gfx design tool for the database structure for linux?

"Access denied for user 'root'@'localhost' (using password: NO)". I've been working on this problem for a day straight and still didn't get anywhere with it . any help? is there a way to set a username and password for the mysql database with the mysql_install_db command?

cjk phpmyadmin has a function
dfgdfgfd, what operating system

fedora core 6

mysql -u root -p

that also gives error 1045

reset root

See http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

archivist, hmm, not really what i am looking for

cjk what do you want

the_wench, thanks, /me looks

archivist, something like db designer 4

well that and its prodigy are a bit borked

borked?

cjk, the lates phpmyadmin does have a designer module
make sure you instal the phpmyadmin db else you wont get it

I've followed http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html and reset the root password, but now executing mysql -u root -p gives "ERROR 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (111)"

!perror 111

Connection refused

done a normal restart?

restarted PC? if so, no

no restarted mysqld

oh damn, no
hold on

im trying to read into how to change the value of several fields in one record at one but i cant seem to find what im looking for.

update xxxx set a=0,b=0,c=1,…. where ….

is there a way to merge a myisam table with another with or witout the DB being online!?
ie flat files merged with a running DB?

What do you mean by merge?

I have 10 timesnaps of mysqlhotcopy outputs and I want to insert them into an existing (identical) DB
prefereably withour offlining the running copy, i did it before but it was hacky

If the table definitions are the same you can try the MERGE engine, which keeps the data separate. If you just want to copy the contents of one table into another table with an identical definition, then use insert into tablea (select * from tableb)

the existing 10 DBs arent being used in a running DB there simply flat MYD MYI files
*they are*

You can't merge them without making them accessible within a running mysql instance

ok then, ty

Good morning!

re

wb

how can i set default charset for all db
?

Hey guys
What must be done to sanitise a string before using it in a query?
Usually I'd use PHP's own function for it, but the language I'm using doesn't have a function to do it now.

Hexxeh, real_escape_string should be in your language as its part of the C api

enterprise.mysql.com seems inaccessible

I'm using Lua :o
And LuaSQL once I find a working binary for 5.1.2

power outage at the datacenter, things coming up now

ok

can't you just compile luasql from source /

hi people, some body can teach me? how is the mysql DBA work?

should i create separate table for condition of car that contain only 5 entries?
php appl

Could, but it would require lots of changes to the new Lua version
Just found a 5.1 version that will work anyway

i know it will breack normalization
break

is it possible to convert seconds to hours?

divide by 3600

i know of SEC_TO_TIME but i need just hours
kimseong can this be done within query?
so just the exact # of hours gets returned

select col div 3600
select col / 3600

oh doh
that looks simple many thanks!
but will it cut the fraction?
so i get 50 and not e.g. 50.12467

/ gives fraction

ROUND()
FLOOR, CEIL

thank you!
i have one last problem - how can i fetch the latest row only and not all of those from certain column?
i tried to limit 1
but that gives the oldest one
how can i reverse that?
n/m sorted

How can I supply multiple args to where?
Like SELECT FROM users WHERE x='y' AND a='b'
Or is that correct?

tias

Try it and see, its quicker to type it on your system and try it than wait for one of us to tell you its ok

it is

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

Comments are closed.


Blog Tags:

Similar posts: