Skip to content

peb7268/MySql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#MySQL Practice Arena This doc will server as a living cheatsheat / knowledge repo for my MySQL adventures.

####Ways to import a file into MySql via the command line:

  1. sql mysql database_name < file.sql That assumes you have created the database already and you dont have to use the -u -p flags at the cli for specifying username and password to MySQL
  2. Alternitively you can create a database, then upload a tab delimited txt file that will import the data for you as shown here. All you do is use the mysqlimport command.
  3. Lastly you can use the source command to load in data from a file. The steps to this are (1) create the db. (2) Change to that db. (3) source somedatabasetable.sql and poof youre done.

####Inspecting the lay of the MySQL land: Seeing which databases are out there: Just run show databases;. Alternitively to see which tables are out there you can run show tables;.

Once you see what databases you have you can select a db to work with by typing use dbname. Then to see what a particular table structure looks like you can type ```` describe tablename `````.

About

MySql Testing Arena

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published