


This article mainly introduces the decompression, installation, backup and restoration of mysql in the windows environment. Friends in need can refer to the following
The system environment is server2012
1. Download the decompression version of mysql. Unzip 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 modifications (according to Required):
[mysqld] # 服务端的编码方式 character_set_server=utf8 # These are commonly set, remove the # and set as required. #数据文件存放目录 basedir = C:\Program Files\mysql #数据文件存放目录 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 # 允许最大连接数 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 mysqld -install
<img src="/static/imghwm/default1.png" data-src="https://img.php.cn/upload/article/000/000/194/b2f31546b96637e8c86469c8ce6510de-1.png?x-oss-process=image/resize,p_40" class="lazy" alt="">
in the command line and the corresponding uninstall command: mysqld -- remove
5. mysql data initialization
Execute the mysqld --initialize-insecure --user=mysql
command to create a root account with an empty password. Note that if the mysqld --initialize command is executed, a random password user will be created.
The initialization data will generate a data folder in the installation directory, as shown below:
Because the setting in the above configuration file is datadir = C:\Program Files\mysql\data
, so the folder name is data.
6. Run net start mysql to start the service.
7. Set the password. Execute the mysqladmin -u root -p password
new password command to set the password for the root user. Here it is 123.
Note that the original password is entered at Enter password and is empty here.
8. Log in
9. View the database
10. Set up remote login
View the user table, as follows:
Execute the command in the database update user set host = '%' where user = 'root';
As shown below:
It is best to refresh the permissionsmysql> flush privileges;
Finally restart the mysql service and you can log in remotely (if remote login is not possible, restarting will usually solve the problem).
C:\Program Files\mysql\bin>net stop mysql MySQL 服务正在停止.. MySQL 服务已成功停止。 C:\Program Files\mysql\bin>net start mysql MySQL 服务正在启动 . MySQL 服务已经启动成功。
11. Forgot password processing
As shown below, open the configuration file my.ini, add skip-grant-tables under mysqld, save and exit, and Restart the mysql service.
After that, you can use mysql -u root -p
to log in without using a password. After
enter the database and execute use mysql
The command switches to the mysql database.
Then execute the following command
update MySQL.user set authentication_string=password('123') where user='root' ; flush privileges;
After making the changes, re-modify the my.ini file and add the skip-grant-tables
Delete this line, save and exit, and restart the mysql service.
It is worth noting that you may encounter an 1820 error when re-entering the database, requiring you to reset your password, as shown below. At this time, you only need to execute the command SET PASSWORD = PASSWORD('123');
That’s it
12. Backup and restore
For testing, create a database mvc
Restore, the syntax is as follows:
mysql -u root -p [dbname] < backup.sql
In the example below, restore the mvc database
The command executed is mysql -u root -p mvc
备份,语法如下:
备份一个数据库多个表
mysqldump -u root -p dbname table1 table2 ... > bakname.sql
备份多个数据库 加上了--databases选项,后面跟多个数据库
mysqldump -u root -p --databases dbname1 dbname2... > bakname.sql
备份所有数据库
mysqldump -u root -p -all-databases > bakname.sql
下图中的示例,只备份一个数据库mvc,同时指定字符集为utf8
mysqldump -u root -p --default-character-set=utf8 mvc >e:\mvcbak.sql
通常,可以使用一些工具进行数据备份与还原,例如Workbench
如果要定时将数据备份到其他服务器,可以使用mysqlbackupftp这个软件。
总结
The above is the detailed content of Detailed explanation of decompression, installation, backup and restoration of MySQL in Windows environment. For more information, please follow other related articles on the PHP Chinese website!

c盘的users是用户文件夹,主要存放用户的各项配置文件。users文件夹是windows系统的重要文件夹,不能随意删除;它保存了很多用户信息,一旦删除会造成数据丢失,严重的话会导致系统无法启动。

启动任务管理器的三个快捷键是:1、“Ctrl+Shift+Esc”,可直接打开任务管理器;2、“Ctrl+Alt+Delete”,会进入“安全选项”的锁定界面,选择“任务管理器”,即可以打开任务管理器;3、“Win+R”,会打开“运行”窗口,输入“taskmgr”命令,点击“确定”即可调出任务管理器。

PIN码是Windows系统为了方便用户本地登录而独立于window账户密码的快捷登录密码,是Windows系统新添加的一套本地密码策略;在用户登陆了Microsoft账户后就可以设置PIN来代替账户密码,不仅提高安全性,而且也可以让很多和账户相关的操作变得更加方便。PIN码只能通过本机登录,无法远程使用,所以不用担心PIN码被盗。

对于刚刚开始使用PHP的用户来说,如果在Windows操作系统中遇到了“php不是内部或外部命令”的问题,可能会感到困惑。这个错误通常是由于系统无法识别PHP的路径导致的。在本文中,我将为您提供一些可能会导致这个问题的原因和解决方法,以帮助您快速解决这个问题。

win10自带的onenote是UWP版本;onenote是一套用于自由形式的信息获取以及多用户协作工具,而UWP版本是“Universal Windows Platform”的简称,表示windows通用应用平台,不是为特定的终端设计的,而是针对使用windows系统的各种平台。

因为win10系统是不自带扫雷游戏的,需要用户自行手动安装。安装步骤:1、点击打开“开始菜单”;2、在打开的菜单中,找到“Microsoft Store”应用商店,并点击进入;3、在应用商店主页的搜索框中,搜索“minesweeper”;4、在搜索结果中,点击选择需要下载的“扫雷”游戏;5、点击“获取”按钮,等待获取完毕后自动完成安装游戏即可。

在windows中鼠标指针呈四箭头时一般表示选中对象可以上、下、左、右移动。在Windows中鼠标指针首次用不同的指针来表示不同的状态,如系统忙、移动中、拖放中;在Windows中使用的鼠标指针文件还被称为“光标文件”或“动态光标文件”。

windows操作系统的特点包括:1、图形界面;直观高效的面向对象的图形用户界面,易学易用。2、多任务;允许用户同时运行多个应用程序,或在一个程序中同时做几件事情。3、即插即用。4、出色的多媒体功能。5、对内存的自动化管理。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools
