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
Table of contents Some basic configuration About ...
filter is generally used to filter certain values...
Swarm Cluster Management Introduction Docker Swar...
There are many tags and elements in the HTML head ...
Table of contents Avoid using the spread operator...
For example, there is an input box <el-input r...
Exporting Data Report an error SHOW VARIABLES LIK...
Table of contents Preface Problem: Large file cop...
In this article, I will explain in detail how to ...
Table of contents MySQL slave library Seconds_Beh...
Linux system version: CentOS7.4 MySQL version: 5....
Table of contents 1. Variable Overview 1.1 Storag...
<br />Looking at this title, you may find it...
1. MySQL download address; http://ftp.ntu.edu.tw/...
MySQL allows you to create multiple indexes on a ...