MySQL5.6 windows7 installation and basic operation

Source: Internet
Author: User
Tags mysql command line

Graphical interface Installation MySQL5.6
About the installation of the graphical interface, more relevant information on the Web, the installation process is omitted here. Select the installation path, required components, and root account password during the installation process.
1, currently for different users, MySQL provides 2 different versions:
MySQL Community Server: Community Edition, this version is completely free, but the official does not provide technical support.
MySQL Enterprise Server: Corporate Edition, which provides a cost-effective data warehousing application for the enterprise, supports acid processing and provides complete commit, rollback, crash recovery, and row-level locking capabilities. However, this version is available for a fee and is supported by official telephone and documentation.
2. Type of MySQL server
Developer machine: This option represents a typical personal desktop workstation. Assume that there are multiple desktop applications running on the machine. Configure the MySQL server to use minimal system resources.
Server machine: This option represents a server that the MySQL server can run with other applications, such as FTP, email, and Web servers. The MySQL server is configured to use the appropriate scale of system resources.
Dedicated MySQL server machine (dedicated MySQL servers): This option represents a server that only runs the MySQL service. Assume that the run is not running other applications. The MySQL server is configured to use all available system resources.
As a beginner, the choice of "Developer Machine" (Developer machines) is sufficient, so that the system resources are not much. In the checkbox to the left of the Enable TCP/IP networking, you can enable or disable TCP/IP networking and configure the port number used to connect to the MySQL server by default enabling TCP/IP networking with a default port of 3306.

3. After installation, a service is added by default in Windows service management MySQL56
The start-Stop command is: NET Start/stop MySQL56
If you use this command to start the Stop times error: Check Server Manager for the correct service name of the MySQL service, check the configuration file:
C:\Program files\mysql\mysql Server 5.6\my-default.ini, plus basedir and DataDir:
# These is commonly set, remove the # and set as required.
Basedir =c:\program files\mysql\mysql Server 5.6
DataDir =c:\program files\mysql\mysql Server 5.6\data
# port = .....
# server_id = ...

4. Add the bin directory of the MySQL installation path in the environment variable path
C:\Program files\mysql\mysql Server 5.6\bin;
Installation is complete.
------------
Note: If you download a non-installation version of the ZIP format installation package, the decompression after the direct modification of the configuration file My-default.ini.
Under the MySQL bin directory, execute the mysqld-install command with administrator privileges, and the MySQL service will be registered in Windows Service Manager. Mysqld-remove uninstalling the MySQL service

======================
MySQL Database connection:
1. Connect to the database using MySQL Command line
Select menu: Start > All Programs >mysql>mysql Server 5.6>mysql 5.6 Command Line Client
Open the MySQL Command Line client program and enter the root password to log into the database.
Enter Password: * * * *
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 10
Server Version:5.6.23-enterprise-commercial-advanced-log MySQL Enterprise server-advanced
Edition (commercial)

Copyright (c), Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

Mysql>
2. Log in to the database using MySQL command, mysql command syntax:
MySQL [-u username] [-h host] [-p[password]] [dbname]
C:\users\administrator>mysql-uroot-prusky
Warning:using a password on the command line interface can is insecure.
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 13
Server Version:5.6.23-enterprise-commercial-advanced-log MySQL Enterprise server-advanced
Edition (commercial)

Copyright (c), Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

Mysql>

3, C:\users\administrator>mysql-uroot-p
Enter Password: * * * *
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 15
Server Version:5.6.23-enterprise-commercial-advanced-log MySQL Enterprise server-advanced
Edition (commercial)

Copyright (c), Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

Mysql>

Second, basic information inquiry
1. View Database Parameters
Mysql> Show variables like ' version% ';
+-------------------------+---------------------------------------------------------+
| variable_name | Value |
+-------------------------+---------------------------------------------------------+
| Version | 5.6.23-enterprise-commercial-advanced-log |
| version_comment | MySQL Enterprise server-advanced Edition (commercial) |
| Version_compile_machine | x86_64 |
| Version_compile_os | Win64 |
+-------------------------+---------------------------------------------------------+
4 rows in Set (0.00 sec)

or:mysql> show variables; --View all parameters

2. Configuring Session Parameters
Mysql> Show variables like '%sort_buffer_size% ';
+-------------------------+----------+
| variable_name | Value |
+-------------------------+----------+
| Innodb_sort_buffer_size | 1048576 |
| Myisam_sort_buffer_size | 69206016 |
| Sort_buffer_size | 262144 |
+-------------------------+----------+
3 Rows in Set (0.00 sec)

Mysql> set session sort_buffer_size= 262148;
Query OK, 0 rows Affected (0.00 sec)

3. Configuring Global parameters
mysql> set global sort_buffer_size=262160;
Query OK, 0 rows Affected (0.00 sec)

Mysql> show global variables like '%sort_buffer_size% ';
+-------------------------+----------+
| variable_name | Value |
+-------------------------+----------+
| Innodb_sort_buffer_size | 1048576 |
| Myisam_sort_buffer_size | 69206016 |
| Sort_buffer_size | 262160 |
+-------------------------+----------+
3 Rows in Set (0.00 sec)


4. View the database character set
Mysql> Show variables like ' character\_set\_% ';
+--------------------------+--------+
| variable_name | Value |
+--------------------------+--------+
| character_set_client | GBK |
| character_set_connection | GBK |
| Character_set_database | UTF8 |
| Character_set_filesystem | binary |
| Character_set_results | GBK |
| Character_set_server | UTF8 |
| Character_set_system | UTF8 |
+--------------------------+--------+
7 Rows in Set (0.00 sec)

5. View all databases
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Performance_schema |
| Sakila |
| World |
+--------------------+
5 rows in Set (0.00 sec)

6. Use connect to a database and view the tables in that database
Mysql> Use World
Database changed
Mysql> Show tables;
+-----------------+
| Tables_in_world |
+-----------------+
| City |
| Country |
| Countrylanguage |
+-----------------+
3 Rows in Set (0.00 sec)

7. View the currently connected database
Mysql> Select Database ();
+------------+
| Database () |
+------------+
| World |
+------------+
1 row in Set (0.00 sec)

8, the creation and deletion of the database
Create DATABASE TestDB;
Drop database TestDB;

MySQL5.6 windows7 installation and basic operation

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.