@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14



Comments:

<0> hehe
<1> Hello, I have a question.. not sure if I should ask it here.. I have been looking around, and can't find what I need.... I need to know how to select the last 5 rows that were inserted into the mysql database.. what would I put in to do this (using mysql 4 / php 5).. Thanks if you can help....
<0> DewKnight: into a specific table?
<1> yes, one specific table.. basically I want to grab the last 5 things an display them (news items)
<0> DewKnight: do they have an ID field?
<1> yes
<0> im not sure how but I think it involves something using SELECT, ORDER, DESC, LIMIT
<0> a select statement saying you want to select by ID, order descending, and limit to 5 results
<2> maybe this will do it... http://pastebin.com/624024
<2> :D
<1> Ah yes, I see now, I will look around for what exactly to use, but that will help. Thank you
<3> polvi, if you repair the table, does the problem go away?
<2> vandemar: repairing now...
<2> this is going to take awhile...
<2> tooo. much. data..



<2> well, after repairing...
<2> mysql> select ip,firstsaw,lastsaw from users where ip=1451209980;
<2> Empty set (0.26 sec)
<2> :\
<2> oh well
<4> how can i recover my mysql p***word?
<4> I'm on the machine that the mysql server is running
<5> !m hawking reset root
<6> hawking: (How to Reset the Root P***word) : http://dev.mysql.com/doc/mysql/en/Resetting_permissions.html
<4> thx Darien
<4> and do you know how to disable anonymous account?
<5> run mysql_secure_installation
<5> it should be the first thing you do anyway
<7> where can i learn the proper ways of designing tables? :P
<7> i **** at mysql... i do everything at the php level and only use mysql to save/read
<7> i do many routines in php, which is inefficient cause im sure if i knew how to use mysql properly i wouldnt need them
<4> Darien: if I run mysql_secure_installation now will it cause any probs with databases,users etc.. I mean you said I have to run it as the first thing
<5> no
<5> it doesn't do anything without asking you anyway
<4> oh ok cool
<8> ALTER TABLE registered MODIFY validate SET NOT NULL; <=== whats wrong with this statement
<9> you are renaming the column from "validate" to "set"
<8> ALTER TABLE registered MODIFY validate validate SET NOT NULL;
<8> this better?
<9> no, it's a SET column, but a SET of what values?
<10> Help I cannot connect to a mysql 5.0 database on a Windows 2003 x64 server. Myodbc causes Access to stop with an unexpected error.
<11> someone tell me.. how can I change a user's p***word? I did "mysql -user=root -p Coppermine" "SET P***WORD FOR 'copperuser'@'%' = P***WORD('newp***'); and it says "Query OK, 0 rows affected (0.00 sec)" .. wtf? I then get an access denied error through coppermine.
<11> hrm. P***word hash changes.. wtf. gawd.
<10> Help I cannot connect to a mysql 5.0 database on a Windows 2003 x64 server. Myodbc causes Access to stop with an unexpected error.
<12> Hi - what's the name of the mysql function that automatically inserts escape characters into a string where needed?
<13> mysql_real_escape_string?
<14> I believe it's quote(stringvalue).. but am not sure
<12> Ah yes, quote() i think is what I'm looking for. Thanks :)
<14> MagicJohn> No problem
<10> Help I cannot connect to a mysql 5.0 database on a Windows 2003 x64 server. Myodbc causes Access to stop with an unexpected error.
<15> is there a function for converting a date to month day, year format? for example SOMEFUNC(2004-01-01) => Jan. 1, 2004 ?
<14> why not write it yourself?
<16> !man date time
<6> (Date and Time Types) : http://dev.mysql.com/doc/mysql/en/Date_and_time_types.html
<16> no.
<15> Shariff: I am still a noob for mysql. But if you point me in the right direction I will give it a shot. How does one write a function in mysql?
<16> !man date functions
<6> (Year 2000 Compliance) : http://dev.mysql.com/doc/mysql/en/Year_2000_compliance.html
<16> Goddammit, one sec
<14> select concat( month(field), '. ', day(field) , ",", year(field))
<16> !man date time functions
<6> (Date and Time Functions) : http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html
<16> Winner!
<16> Look at DATE_FORMAT there, but read over all of them for the next thing you might have to do later :)
<15> Shariff: month(field) returns an integer. Is there a way for me to get a 3 letter month code?
<17> hi
<17> when I convert myisam tables to innodb - do I have to modify indexes in any way?
<14> Not that I noticed
<15> Shariff: ok thanks
<15> Shariff: I guess I have to do a php script
<10> Help I cannot connect to a mysql 5.0 database on a Windows 2003 x64 server. Myodbc causes Access to stop with an unexpected error.
<18> INSERT INTO CategoryDesc (Name, Desc, Pic) VALUES ("something","bad","like that") gives me 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 'Desc, Pic) VALUES ("something","bad","like that")' at line
<18> anyone?
<14> It looks right
<18> hm...lol



<14> it's desc
<14> I thik desc is a reserved word
<14> try this:
<19> NAW
<14> INSERT INTO table (`Name`, `Desc`, `Pic`) VALUES ('something', 'bla', 'more bla');
<20> trying to import records from one DB to another and i get this on import: #1064 - You have an error in your SQL syntax near 'ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=1' at line 60
<20> looks like it'll work if i delete that one line... is that safe?
<14> Just drop the "default charset.... " it'll work most likely
<20> keep engine?
<14> yeah
<20> wont work if i keep engine
<20> yeah... seems to work fine if i just remove everything before the ) on that line
<21> any ideas on how to deal with this?
<21> myisamchk: error: Not enough memory for blob at 1957679524 (need 2127765146)
<21> MyISAM-table 'images' is not fixed because of errors
<22> hi all
<22> on an slave server i got this: Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=canada-relay-bin' to avoid this problem.
<22> my question is, where on the my.conf can i put the --relay-log=canada-relay-bin
<23> Is it bad to have a table with a lot of columbs in each row?
<24> of course not.
<21> hippi: you usuially end up violating the rules of normilization when you do.
<10> Help I cannot connect to a mysql 5.0 database on a Windows 2003 x64 server. Myodbc causes Access to stop with an unexpected error.
<21> hippi: there's nothing wrong per se with having lot of columns. just remember that a db is not a spreadsheet.
<23> I have to store 3 dimensional data and was worried that having a lot of columbs would slow dow querys or something
<23> the question is how scalable this method would be
<23> 100x100 maybe ok, but 1000x1000?
<24> you need to store x,y,z coordinates or something different?
<23> I need to store: 1. yes/no questions 2. "things" 3. anwsers (3 states yes/no/unknow)
<24> ? sounds like 3 or more tables to store the data, not one.
<23> yes, thats what I was going to do, on for questions, one for objects and one for anwsers that refers to the other two
<24> so you're wanting to create a join table between the questions and answers.
<23> but i was hopeing mysql was so magicly optimized that it might be ok to create one huge table
<24> no.
<24> bad practice.
<24> every 'object' as you refer to it above goes into its own table.
<24> including a table that links questions and answers together as its own separate table
<24> it's not really much more work.
<24> but it's crucial to understand the concept if you want to create applications
<23> every object it's own table?! that would mean 100's of tables, did you mean to say something else?
<24> every object cl***, not individual objects.
<24> and every object will be a row in that table.
<24> the columns/fields will be the object's attributes.
<24> there is no database, not even access, that would promote or advocate putting everything into a single table.
<25> Right. Each table would represent objects of a specific type, like persons, businesses, addresses, etc.
<23> well, thanks fot the insight
<23> good night
<24> the truth hurts, i guess.
<25> Well, he could certainly create a model that represents all objects in one table, much information_schema contains top level details about all tables.
<25> uch like
<25> Whether he needs that level of abstraction or not is unknown.
<26> HI Ally
<24> ally mcbeal?
<26> Sorry added the y
<27> I'm looking to setup my php5 install for use with mysql. And what I'm reading tells me that I need to search php.ini for ;extension=mysql.so and uncomment it, but I can't find that line. Is the extension just php4? Or have I just overlooked it in the php5 .ini?
<27> I have also installed php5-mysql module
<27> Ah, nevermind, I finally found it :)
<28> anyone know which will return the results faster, with regards to secure Mysql connections (Mysql on seperate server), OpenSSl or Y***L?
<5> birdfish: you have to make sure you actually compile it in, and then make sure extension=mysql.so is in the conf
<5> it's not always going to do it for you
<29> any Rails developers here?
<30> I just installed MySQL on ubuntu (from apt) and it will not start, saying it can't find the socket... this is in the *install* and starting it through init
<30> this is a fresh system
<30> syslog says it can't bind to :3306 but I can't see anything else using the port
<31> cgl: Perhaps in #rubyonrails
<29> no one in #rubyonrails answered me
<32> did you try #ruby
<33> Davey: setup the initial tables
<29> well, i'm wondering if anyone knows the easiest way to set up mysql w/ Locomotive
<30> frank-: how?
<33> mysql_install_db
<33> as the INSTALL document says
<30> frank-: heh, weirdest thing, I took out the line in my.cnf that binds it to just 127.0.0.1 and it now works
<33> odd
<30> frank-: if I'm supposed to do that, then apt-get wouldn't be trying to start it. It runs that file automatically ;)


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #mysql
or
Go to some related logs:

#css
#gentoo
duo-core processor justification
let i++ bash
#perl
php windows disable-odbc
select queries background mysql high load
gentoo at: command not found
#centos
gimp 48bit



Home  |  disclaimer  |  contact  |  submit quotes