Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SantoshSrinivas79/9e39abc2d13333198796 to your computer and use it in GitHub Desktop.
Save SantoshSrinivas79/9e39abc2d13333198796 to your computer and use it in GitHub Desktop.
Working with MySQL from the terminal command line in Ubuntu 14.04

Working with MySQL from the terminal command line in Ubuntu 14.04

Connect to the database

mysql -uroot -p

Show list of databases

At mysql>

show databases;

Similarly ...

show tables;

Import local database file

At mysql>

envato is the database name I am working on

use envato;

source path/to/file.sql;

Select from table

select * from activeoption order by timestamp desc limit 10;

My MYSQL tablenames case insensitive

Make the following edits:

sudo vim /etc/mysql/my.cnf

Go to the [mysqld] section in the my.cnf file

Add the following entry into the section ...

lower_case_table_names=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment