Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 10 of 13 3 Older Entries

Displaying posts with tag: Beginner (reset)

Beginning on the MySQL Command Line
Employee_Team +0 Vote Up -0Vote Down

If you are starting out on the MySQL command line client, you might be interested in the following information.

When you use the MySQL command line client, it is often useful to log the commands you enter and the response you receive back from the MySQL server. The MySQL 'tee' command allows you to do this very simply and conveniently. Just enter 'tee' followed by the path to the file you want to log the session to (normally referred to as the 'tee' file). From that point on, all your session activity is logged to that file. To cancel tee file logging, just execute 'notee'.

To learn more about getting started on the MySQL Database, …

  [Read more...]
Removing all databases from a MySQL instance
+1 Vote Up -1Vote Down

Many out there will have different ideas about this, some using procs, some using a function, others using a shell script. Well I didn’t want to spend much time on it so decided a group_concat(concat would be enough.
There is no genius, rather laziness :) but what if you have a hundred databases and you want to drop them all?

mysql Thu Mar  3 13:50:06 2011 > pager sed 's/,/ /g'
PAGER set to 'sed 's/,/ /g''
mysql Thu Mar  3 13:50:32 2011 > select group_concat(concat('drop database ',SCHEMA_NAME,';')) from information_schema.schemata where SCHEMA_NAME !='mysql' and SCHEMA_NAME !='information_schema'; …


  [Read more...]
select *,colname | select colname,* that is the question
+3 Vote Up -0Vote Down

Strangely enough, select *,colname from tbname; works just fine, whereas select colname,* from tbname; fails! So if you would like to see all columns, but have one or more of them displayed to the left of the set, you have only one way left to do it ‘comfortably’:

select colname,tbname.* from tbname; well two really but this is really the same
select colname,tb.* from tbname tb;

Because Sharing is Caring

MySQL anonymous accounts – User=”, Host=’%’ – CODE RED
+0 Vote Up -0Vote Down

I want to highlight the importance of reviewing mysql’s initial set of accounts.
Say you have a mysql on abc.def.ghi.jkl running on port 3306 anonymous account with privileges without a password, then:
1. mysql (if issued on localhost)
2. mysql -h abc.def.ghi.jkl
3. mysql -u ” -h abc.def.ghi.jkl
4. mysql -u ” -h abc.def.ghi.jkl -P 3306
5. mysql -u user_which_does_not_exist -h abc.def.ghi.jkl

will all manage to get into mysql given the way mysql authenticates users is against your username and client host from where you are connecting.

This verification is done versus the following …







  [Read more...]
MySQL related bookmark collection
+2 Vote Up -0Vote Down

I am publishing my MySQL related bookmark collection http://www.mysqlpreacher.com/bookmarks/.

Feel free to send me links you think might be good to add in order to help others.

Remember, SHARING IS CARING!!! …. we get so much for free, why shouldn’t we give some back?

Cheers,
Darren

Securich – 0.1.4
+0 Vote Up -0Vote Down

Just a small note to advise that Securich reached 0.1.4.
Some new tools include:
* Added Password complexity
* Enhanced `set_password` – Old password is now necessary to replace it by a new one
* Enhanced Revoke privileges to accept regexp
* Added Block user@hostname on a database level
* Added Creation of reserved usernames
* Added Help stored procedure displays help for each stored proc
* Enhanced `create_update_role` to include the removal of privilages from roles
* Enhanced `grant_priveleges` on `alltables` for a database without tables would terminate …








  [Read more...]
MySQL processlist – (show/kill processes)
+1 Vote Up -0Vote Down

It”s not the most common task in the world, but you might want to view processes from a particular user and once in a while you might even need to kill processes from a single user, be it during an attack or because you simply got a bug in an application bombarding your db server with connections!

Here is a small stored procedure which does exactly that!

call process_list("show","username","hostname");

– shows all processes owned by username@hostname

call process_list("kill","username","hostname");

– kills all processes owned by username@hostname

The code for this stored procedure can be …

  [Read more...]
Save time and energy: How to … (… continued)
+0 Vote Up -1Vote Down

Earlier this year I had published a small blog about being efficient when using mysql prompt. This is a small continuation of it highlighting a couple of other cool features which I really find very useful when working command line (i.e. always!). The first I’m gonna list here is setting the prompt itself by typing –

\R [...]

MCDBA Certification – KPIs
+0 Vote Up -0Vote Down

A few interesting KPIs about certified people and their current location (the fact that many people travel from one country to the other for work is very popular these days especially in the IT sector): Before starting to read, I am hereby assuming the MySQL list of MCDBAs is on a residence basis not citizenship. There are [...]

Save time and energy: How to …
+0 Vote Up -0Vote Down

Save time and energy: How to:

Listening to “Highway to Hell” in an Oxford University computer lab on a sunday afternoon writing a MySQL blog can be legitimally defined by some as sick but thats what a geek calls a relaxing yet productive sunday afternoon.

For the sake of all those CLI ambassadors like myself, I wanted to share a couple of tips and tricks I use quite often when doing my mysql db administration work / scripting. I strongly suggest any mysql dba / dev use CLI simply because thats the one thing you should always have on any machine on which mysql is installed, be it Unix, Linux, Mac, Microsoft or whatever platform you are …

  [Read more...]
Showing entries 1 to 10 of 13 3 Older Entries

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.