MySql and MySql WorkBench

Source: Internet
Author: User

MySql and MySql WorkBench

Install Mysql

1. Download MySQL Community Server 5.6.13

2. decompress the MySQL package
Decompress the downloaded MySQL package to the custom directory. The decompressed directory is:
"D: \ Program Files \ MySQL \ mysql-5.6.13-win32"
Copy the default file my-default.ini in the unzipped directory and change it to my. ini.
Copy the following configuration information to my. ini and save it.
# If there is no my-default.ini, you can create my. ini yourself or get it from somewhere else
######################################## #################
[Client]
Port = 3306
Default-character-set = utf8
[Mysqld]
Port = 3306
Character_set_server = utf8
Basedir = D: \ Program Files \ MySQL \ mysql-5.6.13-win32
# Decompress the Directory
Datadir = D: \ Program Files \ MySQL \ mysql-5.6.13-win32 \ data
# Decompress the data directory in the directory
SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES
[WinMySQLAdmin]
D: \ Program Files \ MySQL \ mysql-5.6.13-win32 \ bin \ mysqld.exe
######################################## #################

3. Add Environment Variables

The procedure is as follows:
1) Right-click my computer-> properties-> advanced system settings (advanced)-> Environment Variables
Click new Under System Variables
Input variable name: MYSQL_HOME
Input variable value: D: \ Program Files \ mysql-5.6.11-winx64
# This is the custom extract directory of mysql.
2) Select the Path in the system variable
Click Edit
Add the variable value % MYSQL_HOME % \ bin to the variable value.
Note that this variable is added after the original variable value and separated by;. The original variable value cannot be deleted,

4. Register mysql as a windows system service

1) log on to the bin directory under the MySQL decompression directory from the console:
2) enter the service installation command:
Mysqld install MySQL -- defaults-file = "E: \ mysqlloshost \ mysql-5.6.14-winx64 \ my. ini"
# Decompress the my. ini file modified in the directory
After the installation is successful, a message is displayed, indicating that the service is successfully installed.
# Note: Put the my. ini file in the root directory after MySQL Decompression
# The command for removing a service is mysqld remove.

5. Start the MySQL Service

Method 1:
Run the following command to start the service: net start mysql.
Method 2:
Open the management tools service and find the MySQL service.
Right-click Start or click Start on the left to start the service.

6. Modify the password of the root account

When the installation is complete, the default password of the root account is blank. You can change the password to the specified password. Example: 123456
C:> mysql-uroot
Mysql> show databases;
Mysql> use mysql;
Mysql> UPDATE user SET password = PASSWORD ("123456") WHERE user = 'root ';
Mysql> flush privileges;
Mysql> QUIT

7. Create a MySQL console shortcut:
1) Right-click the desktop and choose new> shortcut> Object Location. Enter C: \ Windows \ System32 \ cmd.exe.
The shortcut name is defined by yourself. OK. The shortcut is successfully created.
2) Right-click the created shortcut and choose Properties> modify the target column to MySQL startup parameters:
C: Windows \ System32 \ cmd.exe "D: \ Program Files \ MySQL \ mysql-5.6.13-win32 \ bin"/k mysql-uroot-p inventory
Explanation: CMD path "MySQL path bin directory"/k mysql-u username-p Password Database Name
3) Click OK to save the modification. Double-click the shortcut to connect to the MySQL database.

 

MySql WorkBench

1. How to Use workBench to view the ER diagram of the database

Open Database Reverse Engineer Database

 

Click "Next" and select the desired database and corresponding data table.

 

 

 Click "Next" and select "Execte complete", and then click "Finsh ".

 

 

2. WorkBench shortcut

Format SQL statements

Formatted results:

 

If you want to close the current data table, press Ctrl + W to close it quickly. To quickly execute the SQL statement where the current cursor is located, press Ctrl + Enter.

 

3. WorkBench view the number of database connections and connection status of the current server

Management Client Connections

Amount... Write it here first and find that more practical value is being supplemented.

End

Sxian d

D sdf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.