The system environment is server2012 1. Download the decompressed version of MySQL and decompress the installation package to the specified directory 2. In the above directory, copy a copy of the my-default.ini file, rename it to my.ini, and make the following changes (as needed): [mysqld] # The encoding method of the server is character_set_server=utf8 # These are commonly set, remove the # and set as required. #Data file storage directory basedir = C:\Program Files\mysql #Data file storage directory datadir = C:\Program Files\mysql\data port = 3306 # server_id = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES # Maximum number of connections allowed max_connections=200 3. Add environment variables and add C:\Program Files\mysql\bin to the system's environment variable Path 4. Execute the command The corresponding uninstall command: 5. MySQL data initialization Run Initializing the data will generate a data folder in the installation directory, as shown below: Because the setting in the above configuration file is 6. Run net start mysql to start the service. 7. Set a password. Run Note that the original password is entered at Enter password, and this place is empty. 8. Login 9. View the database 10. Set up remote login View the user table, as follows: Execute the command As shown below: It is best to refresh the privileges Finally, restart the MySQL service and you can log in remotely (if you cannot log in remotely, restarting it will usually solve the problem). C:\Program Files\mysql\bin>net stop mysql MySQL service is stopping.. The MySQL service has been stopped successfully. C:\Program Files\mysql\bin>net start mysql The MySQL service is starting. The MySQL service has been started successfully. 11. Forgot password handling As shown below, open the configuration file my.ini, add skip-grant-tables under mysqld, save and exit, and restart the mysql service. You can then use Then enter the database and execute the Then execute the following command update MySQL.user set authentication_string=password('123') where user='root'; flush privileges; After the change, re-modify the my.ini file, delete the It is worth noting that you may encounter error 1820 when re-entering the database, requiring you to reset your password, as shown in the figure below. At this time, you only need to execute the command 12. Backup and restore For testing, create a database mvc To restore, the syntax is as follows: mysql -u root -p [dbname] < backup.sql The following figure shows an example of restoring the mvc database. The command executed is Backup, the syntax is as follows: Back up multiple tables in a database mysqldump -u root -p dbname table1 table2 ... > bakname.sql To back up multiple databases, add the --databases option followed by multiple databases. mysqldump -u root -p --databases dbname1 dbname2 ... > bakname.sql Back up all databases mysqldump -u root -p -all-databases > bakname.sql The example in the figure below only backs up one database mvc and specifies the character set as utf8 mysqldump -u root -p --default-character-set=utf8 mvc >e:\mvcbak.sql Usually, you can use some tools to back up and restore data, such as Workbench If you want to back up data to other servers regularly, you can use the mysqlbackupftp software. Summarize The above is the introduction of decompression, installation, backup and restoration of MySQL under Windows environment. I hope it will be helpful to you. If you have any questions, please leave me a message and I 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:
|
<<: How to mount the CD to find the rpm package under Linux
>>: Detailed explanation of Vue3 sandbox mechanism
First method : CSS code: Copy code The code is as ...
Docker installation Use the official installation...
This article example shares the specific implemen...
mysql returns Boolean type In the first case, ret...
1. Introduction to gitlab Gitlab official address...
The effect is very simple, just copy the following...
General CSS code will only cause minor issues wit...
1. Download MySQL URL: https://dev.mysql.com/down...
Sprite Cow download CSS Lint download Prefixr dow...
Today I am a little confused about <a href=&quo...
I. Introduction First, let me explain the version...
Table of contents 1. Problem 2. Solution 2.1 Pagi...
The difference between http and https is For some...
Table of contents 1. Reverse proxy preparation 1....
Table of contents Normal loading Lazy Loading Pre...