| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Comments:
<m0> hi how would you guys implement access levels? <m0> would you make it numbers, or letters <m0> A user could Insert products, a user could use receipts <mick_linux> m0, what do you mean? <mick_linux> it is specific to your application <mick_linux> do you mean access levels for mysql (who should get insert, alter, drop... permissions?) <mick_linux> or are you asking about business logic in an application <mick_linux> i guess it is business logic (after re-reading the question) <mick_linux> i guess it doesn't matter if you give it an id and a name like: 1 = root, 2 = manager, 3 = registered customer, 4 = non registered customer <mick_linux> m0, though this may not be the best place to ask <mick_linux> ;) <iv26> hi channel <mick_linux> hi iv26 <iv26> a quick question - which maximal value an autoincrementing field may take for int and bigint types? <mick_linux> man numeric types <mick_linux> +man numeric types <mick_linux> damnit <iv26> thanks <m0> mick_linux sorry, yea numbers like 1- root etc <GNN-Ricardo> my log-bin have 100G how i clean it? and start from 0? <mick_linux> http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html <mick_linux> iv26, ^^^ <m0> But they would like it to have read permisisons write permissions, etc <mick_linux> i suggest ACLs <m0> what are ACL's ? <mick_linux> access control lists <mick_linux> i don't suggest something like *nix's bit thing that they do w/ numeric values and sticky bits and other nonsencical crap <m0> Hrmm <mick_linux> http://en.wikipedia.org/wiki/Access_control_list <m0> I would guess a field named access_control is suffient <GNN-Ricardo> my log-bin have 100G how i clean it? and start from 0? <m0> And I add APWA <m0> something , representing different controls <m0> GNN-Ricardo <m0> try reset master; <GNN-Ricardo> what m0? <GNN-Ricardo> reset? <m0> !man binary logs <SQL> (SHOW MASTER LOGS Syntax) : http://dev.mysql.com/doc/mysql/en/SHOW_MASTER_LOGS.html <m0> reset master; deletes binary logs <GNN-Ricardo> i will try, but this is safe? <m0> hmm <m0> I really don't know to tell you the truth <GNN-Ricardo> can i turn the bin-log off? <m0> SHOW BINARY LOGS; <m0> see what it says <m0> If it says ERROR 1381 (HY000): You are not using binary logging <m0> it menas your not using binary logging <m0> !man binary-log <SQL> (The Binary Log) : http://dev.mysql.com/doc/mysql/en/Binary_log.html <mick_linux> GNN-Ricardo, thats a bad idea <mick_linux> FLUSH LOGS. <mick_linux> to delete them <mick_linux> check out: http://dev.mysql.com/doc/refman/5.0/en/log-file-maintenance.html <m0> GNN-Ricardo in yourconfiguration you can specify how big your log size could be <m0> mick_linux - he is talking about binary logs <mick_linux> you should rotate logs <m0> I guess he is talking about this log /var/lib/mysql/log-bin <mick_linux> there is bin-log rotate script in the comments <mick_linux> he could always rm and then touch the log :) <GNN-Ricardo> m0 | fire-bin.000005 | 158678965 | <GNN-Ricardo> | fire-bin.000006 | 27975644 | <GNN-Ricardo> i have no space in DISK that's why i wanna delete the BINARY LOG <gleam-> you can have mysql automatically rotate the logs <gleam-> and just purge binary logs to 'fire-bin.000005' or something <GNN-Ricardo> i do not understand <gleam-> flush logs doesn't delete them <gleam-> you generally want binary logging turned on <GNN-Ricardo> You can delete all binary log files with the RESET MASTER statement, or a subset of them with PURGE MASTER LOGS. See Section 13.5.5.5, “RESET Syntax”, and Section 13.6.1, “SQL Statements for Controlling Master Servers”. <gleam-> yes, but you generally want all binary logs that either your slaves are still reading or that have been generated since your last backup <GNN-Ricardo> i do not have slave :-) <gleam-> but you backup your tables? <GNN-Ricardo> it's a lineage server, www.la.gnn.com.br <GNN-Ricardo> yes every 6 hours <GNN-Ricardo> and sent to a NAS BACKUP SYSTEM in another location <gleam-> good <gleam-> you want to keep thebinary logs between each backup <GNN-Ricardo> i make backup with DUMP, not binary <gleam-> yes that's fine <gleam-> but you want the binary logs anyway <GNN-Ricardo> why i want? <gleam-> imagine you backup at noon and you lose data at 5:45 pm <gleam-> you ahve nearly 6 hours of changes to your data that you lose if you just restore from the backup <gleam-> with teh binary log you can restore from the backup adn then play the last 5h45m of changes back to the server <GNN-Ricardo> if i lose data the server will stop? <gleam-> and have something that looks pretty much identical to when you lost the data <Xgc> Easy: Reset your clocks. <GNN-Ricardo> how could i lose data? <gleam-> magic? <SunShineLady> bad sector for example <gleam-> server crash and data corruption? bad query? bad disk? <GNN-Ricardo> i have this server have 1 year <swytch> on my bsd i often get "write error, disk 105% full" an the like <GNN-Ricardo> and i never got bad disk, bad query. <gleam-> so what? <gleam-> maybe you'll have a bad disk tomorrow. <Xgc> GNN-Ricardo: Someone could accidentally rm -rf / <gleam-> or maybe someone will find a vulnerability in your website and delete all the rows from some table <Elekchron> $qRemove = "DELECT FROM customer WHERE username = '$username' "; is this a correct query? <gleam-> first it looks like a variable definition <gleam-> second, what's DELECT? <GNN-Ricardo> i wanna know, if the log-bin it's activated and i got the server crash and data corruption the log-bin will fix the problem imediatly? <gleam-> no, it won't fix the problem immediately. it will make it easier for you to do a full data restore. <GNN-Ricardo> or the log-bin it's just a log of all queries that modify the database? <gleam-> or, for that matter, possible. <gleam-> it's just a log of queries that modify the db. <GNN-Ricardo> i understand <GNN-Ricardo> how i restore a log-bin? <gleam-> mysqlbinlog <GNN-Ricardo> i open the bin file and delete the last bugged queries? <swytch> DELECT is hot. especially if you forget the WHERE part. <gleam-> no, gnn <gleam-> you use mysqlbinlog to decode the binary log <gleam-> that will show you the queries <gleam-> and then you play back the queries you need to play back <GNN-Ricardo> great! <gleam-> read "man mysqlbinlog" <gleam-> it has lots of handy options. <GNN-Ricardo> and how i clean the bin-log every 1 month? <GNN-Ricardo> or every backup? <gleam-> look at flush logs and purge master logs <GNN-Ricardo> how i execute a query in the mysql command like, mysql -u root -p=x -q=query... <GNN-Ricardo> how i execute a query in the mysql command like, mysql -u root -p=x -q=RESET MASTER; <gleam-> mysql -e "query" <gleam-> and then your other options <GNN-Ricardo> thanks <gleam-> e.g. mysql -e "flush logs" -uroot <dormando> Blargh. <gleam-> indeed <dormando> So I have a master<->master replication pair <dormando> with --log-slave-updates or whatever enabled <dormando> I'm snapshotting and backing up machine B, and machine B's binlogs <dormando> with this setup I can easily restore to machine A and put it back into the cluster with a catastrophic data loss <dormando> but I can't figure out how to restore itself (machine B) without screwing up replication on box A <dormando> what am I missing? :( <dormando> I kinda don't want to snapshot both and keep both binlogs :P <gleam-> you know about "SET SQL_LOG_BIN=0"? <dormando> probably read about it at some point <dormando> gleam; yeah, that does as I expect. not sure how it helps my situation? <dormando> I get lost in bringing all the binlogs up to date. If I'm saving binlogs from host B and am restoring back to host B. Don't I need to know where host A was? <dormando> I'm probably overthinking this :P <dormando> for the restore I need to tell host B to not ignore its own updates temporarly. I apply all of the binlogs that I have, then I need to get the very latest updates from host A since host B's binlogs stopped <dormando> (the goal of the exercize is obviously to restore either host from backups instead of stressing the active server <gleam-> oh right, because you've got log-slave-updates on <dormando> ) <dormando> yeah. without it I couldn't pretend to do that trick <dormando> I also need to use it so I can create read-only slaves hanging off of the cluster if necessary <dormando> and migrate to new hardware platforms without downtime <gleam-> with log-slave-updates does it show the server id of the server that received the initial insert in the binary log? you could probably patch mysqlbinlog to only apply changes froms erver-id=X <dormando> yeah it does. that's not such a big deal though;
Return to
#mysql or Go to some related
logs:
rhel requested were marked to be skipped fglrx forcemonitor #python #gentoo #python union syntax error at or near select at character #debian samba cups ml-2010 No rule to make target libtorrent porholio
|
|