• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

Find mysql commands history without mysql server login

November 19, 2013 by Sharad Chhetri Leave a Comment

This is a small tip to find mysql commands history without login into mysql server.When we login into MySQL server,generally we uses up and down arrow key to find the history of MySQL commands.
Actually the MySQL commands history are saved in file called .mysql_history located in user’s home directory by which he/she logged into Linux System.

For eg. I login into MySQL server after using my system username called linuxworld and after this I log into mysql server,the MySQL history file will be saved in user’s home directory that is linuxworld home directory.
If you log into system with any particular user and then login into mysql server ,only mysql history will be saved in .mysql_history located in this particular user’s home directory.

linux@tuxworld:~$ ls -l .mysql_history 
-rw------- 1 linux linux 2448 Nov 15 20:57 .mysql_history
linux@tuxworld:~$ ls -l ~/.mysql_history 
-rw------- 1 linux linux 2448 Nov 15 20:57 /home/linux/.mysql_history
linux@tuxworld:~$ 
linux@tuxworld:~$ tail ~/.mysql_history 
select time();
select date();
SELECT CURDATE();
SELECT CURTIME();
use owncloud
show databases;
create database owncloud;
use owncloud
show tables;
select * from oc_queuedtasks;
linux@tuxworld:~$ 

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Beginners 4 basic commands of database in mysql server
  2. lock user login after failed login attempts in Red Hat 6.x and CentOS 6.x
  3. how to remove history from Dash Home in Ubuntu
  4. Secondary Logging : Save All Users History Command Output As Log
  5. How to install mysql server in RedHat and CentOS
  6. How to check default storage engine in MySQL server
  7. Set delay replication to MySQL slave server
  8. How to install MySQL Server 5.6 on CentOS 7 / RHEL 7
  9. Non interactive ,without typing password do ssh to Server : By sshpass
  10. How to install mysql server 5.6 on Ubuntu 14.04 LTS ( Trusty Tahr )

Filed Under: Linux, mysql Tagged With: mysql

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

How to reset forgot root password in CentOS 6.x and Redhat 6.x

Virtual Machine inaccessible status on VirtualBox 4.3

rsync all files,hidden files,symlinks,hardlinks to remotes Linux Server

Change default editor of crontab in Ubuntu

How To Get SSH Public Key Fingerprint Information

Learn Linux Date Command With Examples

30 useful Linux terminal keyboard shortcuts

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy