Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure the Green decompressed version of MySQL

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to install and configure the green decompressed version of MySQL. It is very detailed and has a certain reference value. Interested friends must finish reading it!

Procedure:

First, install MySQL database

1. Download MySQL-5.6.17-winx64.zip file.

2. Extract it to the specified directory. In this example, D:\ mysql-5.6.17-winx64.

3. Modify the configuration file, change the name of my-default.ini to: my.ini, and configure the parameters in the file:

[mysqld] # set the installation directory of mysql basedir=D:/ mysql-5.6.17-winx64 # set the data storage directory of mysql database, which must be data datadir=D:/ mysql-5.6.17-winx64/data

Note: the path is a backslash, or it can be changed to two forward slashes, or double quotation marks can be added.

Example:

Datadir= "D:\ mysql-5.6.17-winx64\ data" # mysql Port port=3306 # character set character_set_server=utf8sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

4. Install the MySQL service

Find cmd.exe under the path C:\ Windows\ System32, and right-click to run as administrator (permissions must be strictly differentiated under win 7, which must be as administrator)

Automatic: mysqld-- install [service name]

Manual: mysqld-- install-manual [service name]

Mysqld-install MySQL-- defaults-file= "D:\ mysql-5.6.17-winx64\ my.ini"

Note: be sure to change "- defaults" to "--defaults". The mysqld instruction does not have a-d option, and MYSQL will treat-D as an option whenever it encounters xxxx-dxxxx when parsing parameters.

By default, mysql looks for c:\ my.ini and c:\ windows\ my.ini, my.ini or my.cnf in the installation directory.

5. Start and stop mysql service

Enter the mysql bin directory (D:\ mysql-5.6.17-winx64\ bin >) under the doc command

Enter "net start mysql" to start mysql

Enter "net stop mysql" to stop the mysql service.

II. Root password modification and login

1. Log in

(local) Log into the mysql database in the doc command window, enter the command: mysql-u root-p

Enter and prompt for your password.

Note: the password of the administrator root for the first installation of the mysql decompressed version is empty, so enter directly and log in to the mysql database.

Telnet (extended) configuration

Mysql-h 192.168.80.109-u root-p mysql-h 192.168.80.109-u root-p123456

Note:

-h is the specified login ip

-u specified user

-p specifies the password, if nothing is written after-p, then you will be prompted to enter the password, or you can write the password directly after-p, so you no longer need to enter the password.

2. Modify the root password

Start the mysql service and enter the command:

Use mysql

Use mysql data source, doc command box input

Update mysql.user set password=PASSWORD ('newPassword') where User='root'

Enter the doc command box again:

Flush privileges

After mysql newly set users or change passwords, you need to refresh MySQL's system permissions related table with flush privileges, otherwise access will be denied. Another way is to restart the mysql server to make the new settings take effect.

Note:

During this step, the following problems may occur:

ERROR 1044 (42000): Access denied for user'@ 'localhost' to database' mysql'.

Reason:

Because there is an anonymous account with an empty user name in the user table of the mysql database, although root is used to log in, it is actually logged in anonymously, as can be seen by the'@ 'localhost' in the error prompt.

Solution:

Method 1:

1. Close mysql

# service mysqld stop

two。 Shielding permission

# mysqld_safe-skip-grant-table

The screen appears: Starting demo from.

3. Open a new terminal input

# mysql-u root mysql mysql > UPDATE user SET Password=PASSWORD ('newpassword') where USER='root'; mysql > FLUSH PRIVILEGES;// remember this sentence, otherwise if you close the previous terminal, the original error mysql >\ Q will occur again

Method 2:

1. Close mysql

# service mysqld stop

two。 Shielding permission

# mysqld_safe-skip-grant-table

The screen appears: Starting demo from.

3. Open a new terminal input

# mysql-u root mysql mysql > delete from user where USER=''; mysql > FLUSH PRIVILEGES;// remember this sentence, otherwise if you close the previous terminal, the original error mysql >\ Q will occur again.

Uninstall the installed MySQL

You can view it through Windows's service manager. "start"-> "run", enter "services.msc" and enter enter. Pop up the service manager for Windows, and you can see the service item with the name "MySQL".

Enter D:\ mysql-5.6.17-winx64\ bin > under the doc command and enter "mysqld-remove" or "sc delete mysql" to perform the uninstall service.

The above is all the contents of the article "how to install and configure MySQL Green decompressed Edition". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report