Database: A warehouse in which data is stored and managed according to data structures.
MySQL is a relational database management system
After MySQL is installed ...
MySQL Start-up
1: Find MySQL Right-click on "Services" in the control Panel to start
2: Start menu search cmd and then right-click Admin start input "net start mysql80" to start
Turn off input "net stop mysql80"
Then, when you're done, log in to MySQL.
Parameters for MySQL:
-U: User name
-P: Password
-V: Output version information
-H: Host address
For example, after booting in DOS input "mysql-u (user name)-p (password)" Enter can enter
If you exit, you can enter "Exit" or "quit" or "Q" directly.
Common commands for MySQL
To modify a user password:
Mysqladmin-u (username)-p (old password) password new password
Show Database Commands
show databases; (note semicolon)
Working with databases:
Use MySQL;
After entering a database, use the Select command to display information about the current connection
Displays the currently connected database: Select database ();
Display Server version: select version ();
Show current date Time: select Now ();
Show Current User: Select User ();
Next is the operation of the database
Create a database
Syntax format: CREATE DATABASE [IF not EXISTS] Db_name
[DEFAULT] CHARACTER Set[=]charset_name
The most basic Create database (name);
or create database if not EXISTS (DB name) character set Utf-8;
Modify Database
ALTER DATABASE (first name) character set (new setting);
Deleting a database
Drop database (if exitsts) (name);
Database MySQL Learning (i)