Author: zhangguozhong
Date: 2007-5-12
MySQL version: 5.0.27
1. Start the database.
Command: Net start MySQL
Net stop MySQL
2. Connect to the database:
CMD --> mysql-uusername-ppassword
3. Show:
Show databases;
Show tables;
4. Create a database, create tables, and add constraints...
Create Database dataname.
Drop database dataname
Create Database tablename
Drop table tablename
Delete from tablename -- delete data
Update tablename set pass = '20140901'
5. display table structure
Describe tablename;
6. Import the. SQL File
Source E: My. SQL
7. view the version
Select version ();
Select current_date ();
8. Pi
Select Pi ();
9. View users:
Select User ();
10. Load command (import file ):
Load data local infile "F:/My. SQL" into Table tablename;
11. Remove duplicate rows using distinct.
12. null value operation
13. pattern matching (fuzzy query)
14. function application.
15. The detailed query SQL statement is the same as that in SQL Server2000.
16. database connection:
Try
{
Class. forname ("org. gjt. Mm. MySQL. Driver ");
Conn = drivermanager. getconnection ("jbdc: mysql: // localhost/dbname", "username", "password ");
}
Catch (exception ex)
{
}
Problem:
1. How does MySQL Save the script. SQL file ????
2. Check multi-table data. Besides writing advanced query statements, is there any visualization ????
Learning...