1.mysql Download Installation
Download version 5.6 on the official website (the more stable the better, now the company generally use 5.6), choose Windows,64bit. Download the decompression to see if there are MySQL EXE and Mysqld.exe in the bin directory.
Decompression completed in fact has been installed (download the other people's software is the installation completed), EXE function is to copy files to the hard disk.
2.mysql Basic Operation
Socket server: Switch path from CD to MySQL bin directory, first turn on server mysqld EXE, the socket service side starts up, default ip:127.0.0.1 default port: 3306
Socket client: Switch path to MySQL bin directory with CD, enter command mysql-h127.0.0.1-p 3306-uroot-p #连接服务端ip和port (note port is uppercase P,-u followed by username
No space, Root is the administrator,-P is followed by a password (if the password with a space need to quote, such as-P "1 23" without quotation marks will take the password as 1), the initial no password, is to establish an Administrator account)
Select User (with a semicolon to note) View the currently logged-on users localhost is logged on locally and can be viewed in CMD to view the server and client processes.
Quit;
Mysqld--verbose--help | findstr bind view server-side binding method
Mysqld--bind-address = "0.0.0.0" Bound IP
Mysqld--port = 3306 bound port
As long as the client is connected to two ports and IP access
If it is a native address: The client directly-uroot-p enter the user name and password.
Server terminal is always occupied, running in the foreground, how to let the server terminal in the background to run?
taskkill/f/im Mysqld.exe process name kills process based on process name
tasklist | Findstr mysqld to see if the process still exists
Add the Bin directory to the environment variable
Server: mysqld--install Add Administrator privileges for background running
mysqld--remove Delete Service MySQL needs to stop running first
Re-open the service and enter once Mysqld--install
Run directly in a CMD after opening the service
Direct MySQL does not specify user name User name ODBC
Enter MySQL input \s to view character encoding
[MYSQLD] Server configuration character-set-server=utf8collation-server=utf8_general_ci[client] # Client global configuration (no MySQL-related configuration) Make a unified configuration for all clients Java,c,pythondefault-character-set=utf8[mysql] # Client Configuration Default-character-set=utf8
You can delete the environment variables from the previous database
net stop MySQL stop MySQL service
net start MySQL start MySQL service
Modify the INI file inside the MySQL add user name and password just restart the client can be, do not need to restart the server
If you specify a user name and password under the file header of the INI file, you can log in directly by entering MySQL and do not need to enter-uroot-p
show databases; View all libraries
Enter the wrong username without error, 5.4.0 new feature
MySQL Installation and basic concepts