Professional Web Applications Themes

Clear MySQL History - Remotely - MySQL

Hi there, I was wondering if it's possible to Clear MySQL's History Remotely. Considering that you only have root access to the database but no access to the linux box. I found something in Goggle to do this, but you need to have access to the linux box: cat /dev/null > ~/.mysql_history How can you do this remotely with only root access to the database and not to the linux box?...

  1. #1

    Default Clear MySQL History - Remotely

    Hi there,

    I was wondering if it's possible to Clear MySQL's History Remotely.

    Considering that you only have root access to the database but no
    access to the linux box.

    I found something in Goggle to do this, but you need to have access to
    the linux box:

    cat /dev/null > ~/.mysql_history

    How can you do this remotely with only root access to the database and
    not to the linux box?

    mdavila78 Guest

  2. #2

    Default Re: Clear MySQL History - Remotely

    > I was wondering if it's possible to Clear MySQL's History Remotely. 

    I think (and hope) you cannot do such a thing.



    Regards
    Dimitre


    Radoulov, Guest

  3. #3

    Default Re: Clear MySQL History - Remotely

    On 23 Sep 2006 08:31:32 -0700, mdavila78 wrote: 

    The .mysql_history file is on the machine that runs the client, not the
    server. So, if you're running the client on your machine and connecting
    to a remote database server, you should look on YOUR machine for the
    history file. A machine which, I hope, you should have access to. If
    you're making an insane kind of telnet connection to a CLI on another
    machine to (from there) issue a connect to reach the database, you're
    out of luck. (I cannot rightly understand *why* someone would set a
    sytem up that way, but it's possible. If that's the case, I recommend
    finding a different provider -- you'll share history with every other
    user of the same CLI. Well, I suppose you could try setting your pager
    to "cat /dev/null > ~/.mysql_history" and run "SELECT 'FOO'", then set
    pager back to something else, but...)

    --
    _ o
    |/)
    Peter Guest

  4. #4

    Default Re: Clear MySQL History - Remotely

    mdavila78 wrote: 

    Hmm. Trying to cover your tracks? :-)

    Note that the .mysql_history is a history of commands run by the client
    on that host. So if you have no shell access on that host, SQL
    statements you run won't be recorded in the .mysql_history file on that
    host. They'll be recorded in the .mysql_history file on your client host.

    Anyway, I agree with Dimitre, if you have no shell access on the
    database server host, you have no privilege to modify files there.
    MySQL cannot, and should not, grant that access.

    If you have FTP access, you could upload a zero-length file, copying it
    over a file for which you have write privileges.

    MySQL has other logs which may be recording all queries against the
    server, regardless of the origin client that executed the query. See
    http://dev.mysql.com/doc/refman/5.0/en/query-log.html But this is also
    inaccessible if you don't have shell access on the server host.

    Regards,
    Bill K.
    Bill Guest

  5. #5

    Default Re: Clear MySQL History - Remotely

    Peter H. Coffin wrote: 

    This is not unusual, I have done it frequently. For example, if you're
    trying to reach a host behind a firewall, and telnet (or more likely
    ssh) is allowed through the firewall, but MySQL's port 3306 isn't.

    Another reason is bandwidth: the host to which you telnet is connected
    to the database server by a nice fast network. The two hosts could be
    in the same data center, connected by a gigabit switched network, for
    instance. But suppose your desktop PC is connected to that network via
    a much slower link. You may be in another building, or even halfway
    around the world. Data loads or data dumps would be very quick between
    the two proximal hosts, but very slow if you have to transfer volumes of
    data that way to/from your PC. You might also be sharing the slow link
    with other users, and such use of bandwidth would be interruptive to them.

    Regards,
    Bill K.
    Bill Guest

  6. #6

    Default Re: Clear MySQL History - Remotely

    On Sat, 23 Sep 2006 11:22:07 -0700, Bill Karwin wrote:
     
    >
    > This is not unusual, I have done it frequently. For example, if you're
    > trying to reach a host behind a firewall, and telnet (or more likely
    > ssh) is allowed through the firewall, but MySQL's port 3306 isn't.
    >
    > Another reason is bandwidth: the host to which you telnet is connected
    > to the database server by a nice fast network. The two hosts could be
    > in the same data center, connected by a gigabit switched network, for
    > instance. But suppose your desktop PC is connected to that network via
    > a much slower link. You may be in another building, or even halfway
    > around the world. Data loads or data dumps would be very quick between
    > the two proximal hosts, but very slow if you have to transfer volumes
    > of data that way to/from your PC. You might also be sharing the slow
    > link with other users, and such use of bandwidth would be interruptive
    > to them.[/ref]

    *shrug* I can see the use you're talking about for remote DBA work, but
    the poster in question was supposing no access to the machine he was
    connecting from. I can't see how any of the advantages you're describing
    would be of benefit without access to the machine the CLI is running
    on. There's no access to locally-stored large files to be loaded or
    extracted from the database host. That is, you gotta have access to
    files to get any use out of a LOAD DATA INFILE...

    --
    62. I will design fortress hallways with no alcoves or protruding structural
    supports which intruders could use for cover in a firefight.
    --Peter Anspach's list of things to do as an Evil Overlord
    Peter Guest

  7. #7

    Default Re: Clear MySQL History - Remotely

    >I was wondering if it's possible to Clear MySQL's History Remotely.

    Whose MySQL history? Every user on every machine that uses the
    'mysql' command-line client has their own history in their own
    home directory on their own machine.
     

    If you do not have access to the linux box, how did anything of
    yours get INTO that file in the first place?
     

    You don't. But you can't put anything *IN* the file either, so what is
    it you are trying to erase?

    Gordon Guest

  8. #8

    Default Re: Clear MySQL History - Remotely

    Peter H. Coffin wrote: 

    I know it's not relevant to the OP's situation, I was just pointing out
    that such a situation is not necessarily "crazy" as you termed it.
     

    Well, there's "LOAD DATA LOCAL INFILE ..." which loads a file on the
    client host and sends it over the network connection.

    In the other direction, output of mysqldump is sent over the network to
    be saved on the client side.

    Regards,
    Bill K.
    Bill Guest

Similar Threads

  1. clear chat history when disconected
    By Pcoll in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: March 9th, 09:05 PM
  2. clear history
    By julio in forum ASP.NET Security
    Replies: 1
    Last Post: February 14th, 02:38 PM
  3. How to clear history of commands in unix
    By astrorail in forum Linux / Unix Administration
    Replies: 5
    Last Post: September 9th, 09:39 AM
  4. insert mysql query into a history table... ?
    By Gawie Marais in forum PHP Development
    Replies: 2
    Last Post: June 23rd, 10:53 AM
  5. Connecting to MySQL without storing password in clear text
    By Eto Demerzel in forum PHP Development
    Replies: 0
    Last Post: September 13th, 08:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139