In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install, configure and operate mysql in win, the content of the article is carefully selected and edited by the author, how to install, configure and operate mysql in win has a certain pertinence, and it is of great significance to everyone's reference, the following is to understand the content of the topic with the author.
On the official website www.mysql.com, download the (Windows (x86, 64-bit), ZIP Archive) mysql-5.7.14-winx64.zip of the MySQL package at http://dev.mysql.com/downloads/mysql/, distinguishing between 64-bit and 32-bit. When downloading, you need to register an account to download normally.
a.
b. After clicking, you will go to another page, but do not start downloading. Don't be afraid at this time. It doesn't matter if you don't understand. You just need to know that he wants you to log in (login) or apply for an account (sign up). After logging in or applying for a successful application, you will start downloading. Remember that passwords should be a combination of letters and numbers, and letters should be capitalized.
c. Note: passwords should be a combination of letters and numbers, and letters should have uppercase letters
d. Of course, if you have an account, you can log in directly.
e. Click DownNow after success. The file is not big, just more than 200 M, very soon, wait a moment (after success, it is supposed to arrive at the following place, but if you do not know such words, you find it yourself, or directly back out, repeat the above steps, choose to log in that one.
F.MySQL is an open source (open source) database. Open source means that you can view the source code, so where do you get the source code?
When I first entered-(the address in the first picture). If you have a Select Platform, just select the source code below.
(by the same token, if you want to download MySQL under the linux platform, you are also looking here.)
After the download, let's start with the installation and configuration
Installation steps:
1. The ZIP Archive version is installation-free. All you have to do is decompress it. It's no different from the installation version, but it doesn't need to be installed. Find the downloaded mysql-x.x.xx-winx64.zip and right-select (extract to.), find the place you want to install, default is C:\, but try not to put it under C:\, mine is under D:\ mysql
2, enter the decompression directory, click mysqld.exe, there is a black box there is no response, how to start it?
There is no response because the service is not open yet!
It's not open. Why don't you just open it?
The service is not installed yet!
How to install it?
Keep looking back.
3. Change the default configuration In fact, in theory, we can install the service directly now, but because it is the default configuration, there will be a lot of problems when we use it. For example, the Chinese characters in it are all garbled, so it is recommended that you configure the default file first.
Under the mysql-x.x.xx-winx64 directory (mine is mysql5.7.14, depending on your version), create a new my.ini (the easiest way is to copy the my-default.ini and rename it to my.ini). Copy the following code and save it to ok. My.ini replaces the following my-default.ini file. The .ini file is the configuration file in window. Save all kinds of default data inside. The installation version is to let you choose during the installation and then the system saves it for you. Zip archive is written by yourself, all the same.
As shown below:
Code: (change D:\ mysql\ mysql-5.7.14 to your own software path and save it)
[mysql]
# set mysql client default character set
Default-character-set=utf8
[mysqld]
# set port 3306
Port = 3306
# set the installation directory of mysql
Basedir=D:\ mysql\ mysql-5.7.14
# set the storage directory of the data in the mysql database
Datadir=D:\ mysql\ mysql-5.7.14\ data
# maximum number of connections allowed
Max_connections=200
# the character set used by the server defaults to the 8-bit encoded latin1 character set. The configuration of default-character-set will not be used since MySQL 5.5. it will be renamed character-set-server.
Character-set-server=utf8
# default storage engine to be used when creating new tables
Default-storage-engine=INNODB
4. Install the mysql service
Start-> enter cmd in the search bar of the face, and a cmd.exe will appear on it. Don't be in a hurry to make sure, right-click the cmd.exe and select an administrator to run this option. Otherwise, there will be an error code with insufficient permissions. If the my.ini is misspelled, the error code is 1067. (you can also find the cmd.exe in the C:\ Windows\ System32 directory, also right-click it and identify it as an administrator. )
Run cmd as an administrator (be sure to run as an administrator, otherwise there are not enough privileges)
Enter: cd D:\ mysql\ mysql5.7.14\ bin to enter the bin folder of mysql (no matter whether you have configured the environment variable or not, enter the bin folder, otherwise you will still report error 2 after starting the service)
Enter mysqld-install (if you do not run as an administrator, there will be an error due to insufficient permissions: Install/Remove of the Service Denied!)
To install the service, after opening the cmd window as an administrator, change the directory to the bin directory where you extracted the files, and your own directory shall prevail. Then enter mysqld install and enter to run it. Note that it is mysqld, not mysql.
When Service successfully installed appears, it will be ok.
(if you borrow someone else's picture, you should enter the directory where your mysql is located.)
Start the service, and then type net start mysql to start the service. Or do not bother to manually, open the service and start the mysql service manually.
If error 1067 occurs, it is a configuration file modification error to verify that the configuration file is correct.
(if you borrow someone else's picture, you should enter the directory where your mysql is located.)
A simple way for win to open the service interface. Open Task Manager (right-select Task Manager or ctrl+alt+delete, whatever you like). Click the service below to ok, which is much easier than the control panel method. You can also type services.msc in the cmd window.
Step to > net start mysql startup service, can not afford to start, check the my.ini configuration and path are correct, find the log file, mysql.user can not find, and then initialize the database
D:\ mysql\ mysql-5.7.14\ bin > mysqld.exe-- defaults-file= "D:\ mysql\ mysql-5.7.14\ my.ini"-- initialize-- explicit_defaults_for_timestamp
Later, after the startup reported an error as system error 2, the specified file could not be found, and mysqld-remove mysql could not be reinstalled, and it could not be started manually in the service. I found a solution on the Internet and solved my confusion by modifying the registry entry:
The unzipped version does not specify a directory like the installation version, so you need to change the registry:
HKEY_LOCAL_MACHINE-SYSTEM-CurrentControlSet-services-mysql (Service name)-ImagePath
Change:
"C:\ Program Files\ MySQL\ bin\ mysqld"-- defaults-file= "C:\ Program Files\ MySQL\ my.ini" mysql is
"D:\ mysql\ mysql5.7.14\ bin\ mysqld"-- defaults-file= "D:\ mysql\ mysql5.7.14\ my.ini" mysql
(to change the path in the registry to the file path where the Mysqld.exe is unzipped)
After > net start mysql still reported an error
It was executed again.
> mysqld-remove mysql
> mysqld-install
> net start mysql
Start up normally, Omag.
5. Configure the environment variables of mysql
Right click on my computer-> Properties-> Advanced system Settings-> Environment variables-> path- > Edit, and add
D:\ mysql\ mysql5.7.14\ bin
Or
Increase variable
MYSQL_HOME=D:\ mysql\ mysql5.7.14
Path is added last (most; do not add it; if it is added at the front, it needs to be added at the front;)
;% MYSQL_HOME%\ bin
6. Use
In cmd
Change the directory to D:\ mysql\ mysql5.7.14\ bin
> mysql-uroot-p (I don't have a password when I use it for the first time, but I have a password when I use it. I may have it when I initialized it just now or it comes with 5.7 itself. It is not very clear)
Find the login password, which is in the log file of the data directory (datadir directory configured by my.ini). For example, mine is under D:\ mysql\ mysql-5.7.14\ data. The file name is computer .err; for example, my computer name is server-10, and the password is in the server-10.err file. Open the file, ctrl+f, and search for the password or root@localhost keyword with notepad or notepad++ or any text editor.
Find the following line of information:
2016-03-16T02:41:45.969406Z 1 [Note] A temporary password is generated for root@localhost: r1diaBlw&Hgp
The corresponding login password is r1diaBlw&Hgp
> mysql-uroot-p
Enter the password found above
Mysql > set password = password ('password')
Mysql > exit
Log in with a new password
> mysql-uroot-p
New password
Mysql > show databases
Mysql > create database XXX default charset utf8
Mysql > grant all privileges on *. * to 'root'@'localhost' identified by "password"
Under cmd (when environment variables are added):
Export the database command line:
Mysqldump-u database user name-p database name > exported database file
Example: mysqldump-uroot-p db1 > g:\ liongg.sql (export database db1 to liongg.sql file)
After entering, you will be prompted to enter the password, and if you enter nothing, you will enter directly, and you will be successful in a moment.
Import the command line of the database:
Mysql-u database user name-p database name < imported database file
Example: mysql-uroot-p db2g:\ liongg.sql.
Others are similar.
Under win, you must enter exit to exit when the mysql is used up, otherwise you will not quit.
7. the above is the command line management database, and the following are several commonly used graphical database management software
I would like to recommend several graphical management tools for you:
1 、 phpMyAdmin
2 、 MySQLDumper
3 、 Navicat
4 、 MySQL GUI Tools
5 、 MySQL ODBC Connector
8. Delete the files used by mysql and make them smaller. Optimize the debug and * .pdb files in other directories such as lib.
After reading the above about how to install, configure and operate mysql in win, many readers must have some understanding. If you need more industry knowledge and information, you can continue to follow our industry information section.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.