Installation and configuration methods and precautions for MySQL on Windows, mysql on the platform

Source: Internet
Author: User

Installation and configuration methods and precautions for MySQL on Windows, mysql on the platform

2.1. msi installation package

2.1.1 Installation

Note that you must delete the original my. you can change the name of ini and the original data directory. Otherwise, a 1045 error will be reported "apply security settings" in the last step. Cause 1: Firewall, cause 2, and the data file is not cleared.

Choose custom for next installation.

You can specify the data location instead of the system disk.

By the way, select "detailed configuration"

Depending on the development or production environment, the type and purpose of the server

"Bestsupport for multilingualism" supports most languages. The default character set is UTF-8. Use this.
"Addfirewall exception for this port" is recommended, especially on the development machine.
"Enabledstrict mode" is recommended for production machines, which are not needed by development machines. If you select this mode, problems that require attention at the beginning may occur.
"Includebin directory in windows path" is strongly recommended. Otherwise, you must manually configure the path

"Createanonymous account ".

If there is no accident, it will be done successfully.
 

Solution to root login failure after installation

Mysql-h localhost-u root-p
Cmd
Net stop mysql
Mysqld -- skip-grant-tables

# Note: netstart mysql -- skip-grant-tables can be started, but it does not seem to work.

The window may die, no matter. open another window.

Cmd
Mysql-u root

I found it went in.

Use mysql

Update user set password = password ("new password") where user = 'root' and host = 'localhost ';

Flush
Previliges;

OK. Pay attention to the following points:

1. net start mysql -- skip-grant-tables, which can be started, but it does not seem to work.
2. mysql is a built-in database.
3. the user table stores the user name, password, and permissions in the mysql database.
4. Use the password () function to encrypt the password.
5. If the host = 'localhost' condition is not required, all the root passwords have changed. We do not recommend that you do this. I will briefly discuss the mysql users later.
6. In this case, the set Method mysqlamdin-u root-p password "new password" cannot be used to change the password, only by directly modifying the database

2.1.2 uninstall

1. You can uninstall it on the control panel.
2. Double-click the original installation package and select "remove" to uninstall the package.

2.2. zip file (not verified)
2.2.1 Installation

1. Download mysql
2. decompress the package to c:/mysql.
3. Copy my-large.ini to c:/windows/my. ini
4. Modify the my. ini file

Basedir = "c:/mysql" installation directory
Datadir = "c:/mysql/data" data Directory
[WindowsMySQLServer]
Server = "c:/mysql/bin/mysqld.exe"

5. Install the service

C:/mysql/bin/mysqld.exe -- install

6. Start/Close the service

Net start/stop mysql

2.2.2 uninstall

C:/mysql/bin/mysqld.exe -- remove

2.3 common command parameters and usage methods
; ==\ G

\ G after the command, the display will be more beautiful

2.3.1. mysql

-Hhost
-Uuser
-Ppassword)
-Pport, generally 3306 is not commonly used

Database Name of databasename, equivalent to executing the use database

-E "SQL" execution statement

Mysql-h localhost-u root-ppassword mysql-e "select user, host from user"

2.3.2. mysqladmin

A) change the password

Mysqladmin-u root-p password "new password"

Note:

1. password is equivalent to a function and required
2. The new password should be expanded with double quotation marks

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.