As Sys admins we are often tasks with working on multiple and disparate systems we need to know a little about everything to allow use to do our jobs effectively. This post will detail my top five MySQL commands to know – with one bonus command! The commands are:
- Create database wordpress;
- This command creates a database call wordpress.
- Show databases;
- The Command shows all databases that reside on the server.
- Use wordpress;
- Selects the wordpress database for use – all subsequent commands will run the wordpress database.
- show tables;
- Shows all tables within the current selected database.
- select * from courses;
- Displays all information from the courses table.
- Bonus Command! grant all on WordPress.* to ‘wordpressuser’@’localhost’ identified by ‘wordpresspass’;
- Grants all permissions on the WordPress database from the user wordpressuser from the local machine with the password wordpresspass
If you want to see these commands in action check out the youtube video here:
Also be sure to download the cheetsheet here which you can save and print out: