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, 2. Change the root password Start the mysql service and enter the command: 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: 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:
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 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 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:
|
<<: 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
1. Preparation 1.1 Download and install VMware 15...
Doccer Introduction: Docker is a container-relate...
<br />From the launch of NetEase's new h...
1: Throughput (Requests per second) A quantitativ...
This article example shares the specific code for...
When making a web page, we usually need to consid...
Table of contents Preface The need for online XML...
Article mind map Why use master-slave replication...
Vulnerability Introduction The SigRed vulnerabili...
Table of contents What is a Promise? Usage of rej...
This article example shares the specific code of ...
This article mainly introduces 6 solutions to the...
Install lua wget http://luajit.org/download/LuaJI...
Let me first introduce to you that the node proce...
Table of contents Discover: Application of displa...