MySQL green decompression version installation and configuration steps

MySQL green decompression version installation and configuration steps

Steps:

1. Install MySQL database

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

2. Unzip to the specified directory, in this case D:\mysql-5.6.17-winx64.

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

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

Note: The path is a backslash, you can also change it to two forward slashes, or add double quotes.

example:

 datadir="D:\mysql-5.6.17-winx64\data"
    #mysql port port=3306
    # Character set character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

4. Install MySQL service

Find cmd.exe in the path C:\Windows\System32, right-click and run as an administrator (win 7 strictly distinguishes permissions, you must run as an 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 command does not have a -d option, and when MYSQL parses parameters, it will treat -D as an option as long as it encounters xxxx-dxxxx.

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

5. Start and stop the 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.

2. Root password modification and login

1. Login

(Local) Log in to the MySQL database in the doc command window and enter the command: mysql -u root –p

After pressing Enter, you will be prompted to enter your password.

Note: When you first install the decompressed version of MySQL, the administrator root password is blank, so just press Enter again to log in to the MySQL database.

Remote login (extended) configuration

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

Notes:

-h is to specify the login ip,
-u specifies the user,
-p specifies the password. If you do not write anything after -p, you will be prompted to enter the password. You can also write the password directly after -p, so you do not need to enter the password.

2. Change the root password

Start the mysql service and enter the command:

use mysql

Use the mysql data source and enter the doc command box.

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

Then enter the following command in the doc command box:

flush privileges;

After setting up a new MySQL user or changing the password, you need to use flush privileges to refresh the MySQL system permission related tables, 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 account with an empty username, that is, an anonymous account, in the user table of the MySQL database, the login is actually anonymous even though the user is root, which can be seen from the ''@'localhost' in the error message.

Solution:

Method 1:

1. Shut down mysql

# service mysqld stop

2. Block permissions

# mysqld_safe --skip-grant-table

The screen appears: Starting demo from .....

3. Open a new terminal and enter

# 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 will appear againmysql> \q

Method 2:

1. Shut down mysql

# service mysqld stop

2. Block permissions

# mysqld_safe --skip-grant-table

The screen appears: Starting demo from .....

3. Open a new terminal and enter

# 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 will appear againmysql> \q

3. Uninstalling the installed MySQL

You can view it through the Windows Service Manager. "Start" -> "Run", enter "services.msc" and press Enter. The Windows Service Manager pops up, and then you can see a service item with the service name "MySQL".

Under the doc command, go to D:\mysql-5.6.17-winx64\bin>enter "mysqld -remove" or "sc delete mysql" to uninstall the service.

Summarize

The above is the installation and configuration steps of the green decompressed version of MySQL introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • MySQL 5.6 binary installation process under Linux
  • Graphic tutorial on installing the latest version of MySQL server on Windows 7 64 bit
  • Detailed explanation of the idea of ​​installing mysql8.0.11 and changing the root password and connecting navicat for mysql
  • Solve the problem of Ubuntu pip installing mysql-python package
  • Package example of installing mysql-python under Anaconda
  • Summary of the installation process of MySql 8.0.11 and the problems encountered when linking with Navicat
  • Methods and problems encountered in installing mariadb in centos under mysql
  • Ubuntu 18.04 MySQL 8.0 installation and configuration method graphic tutorial
  • MySQL 8.0.11 compressed version installation and configuration method graphic tutorial
  • MySQL Community Server 8.0.11 installation and configuration method graphic tutorial
  • Detailed installation process of MySQL 8.0 Windows zip package version
  • MySQL 5.7.21 decompression version installation and configuration method graphic tutorial
  • MySQL 8.0.11 Installation Tutorial under Windows
  • Detailed tutorial for installing MySQL 8.0.11 compressed version under win10
  • MySQL installation diagram summary

<<:  Detailed explanation of the difference between $router and $route in Vue

>>:  How to handle the tcp_mark_head_lost error reported by the Linux system

Recommend

Ubuntu 19.04 installation tutorial (picture and text steps)

1. Preparation 1.1 Download and install VMware 15...

Docker Getting Started Installation Tutorial (Beginner Edition)

Doccer Introduction: Docker is a container-relate...

User experience of portal website redesign

<br />From the launch of NetEase's new h...

Apache Bench stress testing tool implementation principle and usage analysis

1: Throughput (Requests per second) A quantitativ...

Native js implementation of magnifying glass component

This article example shares the specific code for...

A quick solution to the problem of PC and mobile adaptation

When making a web page, we usually need to consid...

Example of making XML online editor using js

Table of contents Preface The need for online XML...

Detailed explanation of MySQL master-slave replication and read-write separation

Article mind map Why use master-slave replication...

Windows DNS server exposed "worm-level" vulnerability, has existed for 17 years

Vulnerability Introduction The SigRed vulnerabili...

Detailed explanation of ES6 Promise usage

Table of contents What is a Promise? Usage of rej...

Vue+element ui realizes anchor positioning

This article example shares the specific code of ...

6 solutions to IDEA's inability to connect to the MySQL database

This article mainly introduces 6 solutions to the...

How to add Lua module to Nginx

Install lua wget http://luajit.org/download/LuaJI...

Research on the effect of page sidebar realized by JS

Table of contents Discover: Application of displa...