MySQL #1

2 12 2011

MySQL is the world’s most popular open source Relational Database Management System (RDBMS).
It is a popular choice for use in Web Applications because it is secure, robust, fast, Multi-Platform and very important these days: free!
Perfect for small to medium applications.

Some useful commands to start:

  • mysqladmin -u root -ppassword create databasename # Creates a new database
  • mysql -u root -p # Command used to connect to MySQL (The password request will be prompted)
  • mysql -u root -ppassword_name # Command used to connect to MySQL (no space between the -p and the password)
  • mysql -u root -ppassword database_name # Command used to connect with MySQL and start using a database
  • mysql -u root –password=password_name database_name # Command used to connect with MySQL and start using a database
  • CREATE DATABASE database_name; # Allows to create a database
  • SHOW DATABASES; # Show all Databases
  • USE database_name; # Allows us to change database
  • SELECT DATABASE(); # Tells which database is currently being used
  • \q; # This command allows us to exit from the Database;
  • mysqladmin -uroot -p’old_password’ password new_password  #command used to change the root password