Java EE Development Environment (2) --- (MySQL installation), javaeemysql
The last time I wrote jdk installation in the Java EE development environment, I felt that sometimes the image loading was not smooth, so I added less images this time ~~
Install MySQL in Java EE Development Environment 1: Download mysql
Search mysql in Baidu to go to the official website (http://www.mysql.com /)
Add "downloads/mysql" to the URL
Then the page will jump to the mysql download page (http://dev.mysql.com/downloads/mysql/) (you copy it here can also ~~ The above is just to tell you how to find the download location ~~)
It mainly looks at the area in the red box: You can select your system type, and you can download the source code ~~
If the image cannot be displayed, write down the drop-down box below Select Platform and Select the system type ~~
Then select the file you want to download ~~ I use win764 bits ~~ Therefore, windows (x86, 64-bit) and ZIP Archive ~~ are selected ~~ Click Download ~~ Jump to page ~~
Then ~~ If you have an oracle account, click sign up if login does not exist. register an account and log on again.
After logging on to the console, you will be redirected to the download page. Click download Now to download the selected file ~~
Then ~~ Download successful ~~
2: install and configure mysql
Decompress the downloaded zip file to the desired location.
I am still in D: \ develop
My mysql path is: D: \ develop \ mysql-5.7.12-winx64
Open the mysql folder and create a new data folder in the folder (if you download an old version of SQL that may already have a data folder, you do not need to create it)
Right-click the my-default file and change the file content.
Content to be modified:
# Basedir = D: \ develop \ mysql-5.7.12-winx64 -- mysql file path
# Datadir = D: \ develop \ mysql-5.7.12-winx64 \ data -- mysql data File Path
# Port = 3306 -- "port number
Save and change the file name to my. ini (Note: Check whether the file name suffix of your folder/file is hidden ...)
Open cmd as an administrator
Find your mysql location
--------------------------------------------------------------------------------
C: \ Windows \ system32> d:
D:> cd D: \ develop \ mysql-5.7.12-winx64 \ bin
--------------------------------------------------------------------------------
Enter the following command:Mysqld -- initialize -- user = mysql -- console press ENTER ~~
Then you have content in the data folder ~~ A random password will also be generated ~~
A temporary password is generated for root @Localhost: x? & Ji. iL4sLL
--------------------------------------------------------------------------------
D: \ develop \ mysql-5.7.12-winx64 \ bin> mysqld -- initialize -- user = mysql -- console
2016-05-22T04: 08: 351_38482z 0 [Warning] TIMESTAMP with implicit DEFAULT value is
Deprecated. Please use -- explicit_defaults_for_timestamp server option (see doc
Umentation for more details ).
2016-05-22T04: 08: 351_38482z 0 [Warning] 'No _ ZERO_DATE ', 'no _ ZERO_IN_DATE' and 'e
RROR_FOR_DIVISION_BY_ZERO 'SQL modes shoshould be used with strict mode. They will
Be merged with strict mode in a future release.
2016-05-22T04: 08: 351_38482z 0 [Warning] 'No _ AUTO_CREATE_USER 'SQL mode was not s
Et.
2016-05-22T04: 08: 36.692576Z 0 [Warning] InnoDB: New log files created, LSN = 45790
2016-05-22T04: 08: 3710978598z 0 [Warning] InnoDB: Creating foreign key constraint
System tables.
2016-05-22T04: 08: 37.146602Z 0 [Warning] No existing UUID has been found, so we
Ssume that this is the first time that this server has been started. Generating
A new UUID: dbbb85d0-1fd2-11e6-8ae2-4c809368d1e7.
2016-05-22T04: 08: 37.152603Z 0 [Warning] Gtid table is not ready to be used. Tabl
E 'mysql. gtid_executed' cannot be opened.
2016-05-22T04: 08: 37.175604Z 1 [Note] A temporary password is generated for root @
Localhost: x? & Ji. iL4sLL
D: \ develop \ mysql-5.7.12-winx64 \ bin>
--------------------------------------------------------------------------------
Remember this password and use it now ~~
Run the following command to install mysql:Mysqld install (Note: mysqld is not mysql)
Then enter the command to start mysql -- "net start mysql
Prompt that the service has been started successfully ~~
Then enter the command to log on to mysql -- mysql-u root-p
It will prompt you to Enter the password -- "Enter password:
The password is the one you remember above ~~
Tip: In the cmd command, the ctrl + v paste command cannot be used ~~ Therefore, you want to paste ~~ You can only right-click and select Paste ~~
After entering the password, click "enter ~~
Congratulations ~~ Mysql is successfully entered ~~
If you are prompted that the password is incorrect, it may be that you have installed mysql or that your password is incorrect... please check carefully or enter the old password ~~
After logging on to mysql, change the login password to one that you remember ~~ Lest you forget...
Enter the command: set password = password ('20140901'); -- "123456 is the password I want ~~ The extra points must be added later ~
Then you will be prompted: Query OK, 0 rows affected, 1 warning <0.00 sec>
Indicates that your password is successfully modified ~~
Here for an experiment ~~
Enter exit to exit mysql ~
Enter mysql-u root-p
Enter the changed password ~~ Mysql ~ Password modified successfully ~~
Oh YEAH !!~~ Basically, mysql has been installed ~~
However ~~ Do you think it is very troublesome to enter the mysql folder every time?
So ~~ We need to configure mysql to environment variables ~~
Right-click my computer> Properties> advanced system Settings> environment variables> path> Edit
Before the variable value, add the path of your mysql bin folder + ";" ~~
My is: D: \ develop \ mysql-5.7.12-winx64 \ bin;
Then open the doc window again.
Enter directlyMysql-u root-p
How is it? You can enter the password and enter mysql ~~
If the system prompts that the command cannot be found ~~ Which of the following statements is wrong when you write the bin path ~~ Look for it ~~
So far ~~ The installation of mysql is complete ~~ Yes ~~