Transfer from http://blog.csdn.net/longyuhome/article/details/7913375
We all know that MySQL is a small and medium-sized relational database management system, very practical, for us to learn a lot of technology is helpful, a few days ago I installed SQL Server 2008 and Oracle 10g database, also used JDBC to connect them, there is no garbled. Yesterday to see the classmate with Java connection MySQL database, there is garbled, this is I do not know, I immediately go online to check JDBC Connection MySQL operation, found in the JDBC connection to the MySQL database to pass a can solve garbled parameters, To insert data that is not garbled into the database. This is because when the database is installed, the correct encoding is not chosen. So this is one of the reasons I want to install MySQL database, want to experience the following it, plus the class of machine configuration is relatively low, installed MySQL database to do experiments is the best choice, it is because of these two reasons I installed the MySQL, in the process of installation some problems let me pay attention to, During the installation process I took the steps to intercept the diagram, I hope to be helpful to those who need it, my database is 5.5.21 this version.
The following is a description of what was added after December 21, 2012:
Look at this blog is very good, so add the MySQL download process, I hope to be helpful to those who need:
1, first in Baidu search MySQL, select the first search term,:
2. In the open page, select the "Download" Connection in:
3., for MySQL download is divided into multiple versions, we only need to download the server is enough. About 30M More, select the connection,:
4. Last offer 5.5.28 Download Connection address for this server:
Http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.28-win32.msi
Next is the installation steps for my MySQL database server:
1, first click the installation file of MySQL5.5.21, the Installation wizard interface of the database appears, click "Next" to continue the installation:
2. In the open window, select accept the installation agreement, click "Next" to continue the installation:
3, in the selection of installation Type window, there are "typical (default)", "Complete", "Custom (User Defined)" Three options, we choose "Custom", because through customization can let us more familiar with its installation process, Useful for Learning MySQL database, click "Next" to continue the installation:
4, in the Custom installation interface, select the installation path of MySQL database, here I set the "D:\Program file\mysql", click "Next" to continue the installation:
5, next into the ready to install the interface, first confirm the previous settings, if wrong, press "back" to return, no errors, click the "Install" button to continue to install:
6, click the "Install" button appears following the installation of the interface, after very little time, the MySQL database installation completed, the completion of the MySQL installation interface,:
This interface clicks "Next" on the line.
Note To select the "Launch the MySQL Instance configuration Wizard" option above, this is the configuration to start the MySQL, but also the most critical place (can also be set later), click the "Finish" button to enter the configuration interface.
7, the installation of MySQL database is very simple, the key is the configuration after the completion of the installation, click to complete the following Configuration Interface Wizard, click "Next" To configure:
8, in the Open Configuration Type window to select the way of configuration, "Detailed configuration (manual precise configuration)", "Standard Configuration", in order to familiarize ourselves with the process, we choose "detailed Configuration (manual and precise) ", click" Next "to continue:
9. In the window that appears, select the type of server, "Developer Machine (Development test Class)", "Server machine (server type)", "Dedicated MySQL server machine (dedicated database server)", We are only used for learning and testing, the default is OK, click "Next" to continue,:
10, in the configuration interface that appears to choose the purpose of MySQL database, "Multifunctional database (General purpose)", "Transactional database only (server type)", " Non-transactional Database only (non-transactional) ", here I select the first item, generic installation, click" Next "to continue the configuration:
11, in the appearance of the interface, to InnoDB tablespace configuration, is to select a storage space for InnoDB database files, if modified, to remember the location, reload the time to choose the same place, otherwise it may cause database corruption, of course, A backup of the database is no problem:
12. In the open page, select the number of MySQL visits, simultaneous connections, "decision Support (DSS)/olap (20 or so)", "Online Transaction Processing (OLTP) (500 or so)", "Manual Setting (manually set, set to 15) Select manual Settings Here, click" Next "to continue:
13, in the open page to set whether to enable TCP/IP connection, set the port, if not enabled, you can only access the MySQL database on their own machine, which is connected to Java operation, the default port is 3306, and enable strict syntax settings, if there is an error later, you can "add Firewall exception for this port "Select this option, click" Next "to continue:
14, in the Open character encoding page, set MySQL to use the character encoding, the first one is the Latin code, the second is a multi-byte universal UTF8 encoding, the third is manual, we choose Utf-8, if there is no choice UTF-8 this encoding, When using the JDBC Connection database, there will be garbled, then need to add the following code "Useunicode=true&characterencoding=utf-8", to solve the garbled problem, for the convenience of later so set to UTF-8 encoding , but there is a problem, that is, when using which console to insert Chinese characters, will error, query with Chinese characters table, unable to display Chinese characters, where you need to set a system parameter "set names GBK" after each entry to MySQL, you can solve the problem, then click " Next ", continue with the configuration:
15. In the open page, choose whether to install MySQL as a Windows service, you can also specify the service name (the Services identity name), whether to add the MySQL bin directory to Windows PATH (after joining, you can directly use the file under Bin, Instead of pointing out the directory name, such as a connection, "Mysql–u username–p password;" Yes, click "Next" to continue with the configuration:
16, in the open page set whether to modify the default root user (super Administrator) password (default is empty), "New root password", if you want to modify, fill in the new password here, and enable the function of root remote access, do not create anonymous users, click "Next" Continue the configuration:
17, to here all the configuration operations have been completed, click the Execute button to perform the configuration:
18, after a few minutes, appears the following prompt interface on behalf of the MySQL configuration has ended, and prompted the success of the information.
19. Start the MySQL database in the service and enter "Mysql–h localhost–u root-p" or "mysql-h localhost-uroot-p password" in the command window, then enter the user's password in the prompt that appears:
You can see that the MySQL database was successfully logged in after it was started, where we can operate the database.