First, the introduction of the JDBC concept
JDBC is a set of interfaces, implementation classes are jar packages (provided by the provider of the database vendor)
does not care about the content of the implementation class at all. A method that only cares about interfaces (that is, JDBC only )
second, the introduction of MySQL, green package download
Https://www.oracle.com/index.html
Download URL:https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-winx64.zip
command to change password: Alter user ' root ' @ ' localhost ' identified by ' 123 ';
Original password:
Iii. Configuration of mysql5.7 1, unzip the green versionMySQL,and renamed tomysql5.7, such as
2. Installation Services
(1), run cmd (Administrator version, otherwise no permissions), such as
(2), for the new mysql5.7 no more. Data directory, we need to run the command to create
(3), run the command Mysqld–install installation services, such as:
If you don't need MySQL , just run mysqld–remove to remove it, such as
(3), run the net start MySQL startup service, such as
If you need to configure whether booting up MySQL can be configured within the Windows service.
3. Client Testing
(1) ,mysql–uroot–p such as
4.Modify user name password
(1), Run Command
Use MySQL;
UPDATE user SET Authentication_string=password (' 123456 ') where user= ' root ';
FLUSH privileges;
(2), re-login, Run command mysql-uroot-p123456
5, the configuration code isUTF-8
(1), view the default encoding
(2), in the root directory of mysql5.7, create a new My.ini file, (5.7 After this file, own new), such as:
When the Mysql service program starts, it automatically reads the my.ini to get the configuration parameters, including the encoding
(3), Edit My.ini
[Client]port=3306default-character-Set=Utf8[mysqld]port=3306 character_set_server=utf8# Extract directory Basedir=f:\mysql5. 7 #解压目录下data目录datadir=f:\mysql5. 7 \data Sql_mode=no_engine_substitution,strict_trans_tablesskip-grant-tables
6. Test Query
(1), modify the configuration file must first restart the service
(2) , normal use Root User Login
(3) , Run command show variables like "%character%" to View system character set variables such as:
Iv. Configuration of mysql5.6
Why am I here again to say mysql5.6 configuration, I think some people will install version 5.6, also convenient for us to distinguish between 5.6 and 5.7 version of the difference where
1,ConfigurationMysqlDatabase
(1), Unzip the green version of MySQL, such as
2. Installation Services
(1) , run cmd (Administrator version, otherwise no permissions), such as
(2), run the command Mysqld–install installation services, such as:
If you don't need MySQL , just run mysqld–remove to remove it, such as
(3), run the net start MySQL startup service, such as
3. Client Testing
(1), mysql–uroot–p such as
4. The Configuration code isUTF-8
(1) , under the root directory of mysql5.6, copy the My-default.ini file, and name it My.ini, such as:
When the Mysql service program starts, it automatically reads the my.ini to get the configuration parameters, including the encoding
(2), editor My.ini
in the [Mysqld] node, configure the service-side encoding, add 2 Item Content
Character_set_server=utf8
Such as:
If something similar to DEFAULT-CHARACTER-SET=GBK already exists under this tag , just modify it.
In addition, the default is no [MySQL] node, this is the configuration of the client information
We also add [MySQL] node, and configure the encoding UTF8 , such as:
[MySQL]
Default-character-set=utf8
5. Test Query
(1), modify the configuration file must first restart the service
(2), normal use of the root user login
(3), Run command show variables like "%character%" View system Character set variables , such as:
6, modify the user name password
(1), Run command
Use MySQL;
UPDATE user SET Password = Password (' 123456 ') WHERE user = ' root ';
FLUSH privileges;
Such as:
(2), re-login, Run command mysql-uroot-p123456
The introduction of JDBC and the introduction of MySQL