Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

Windows下MySQL安装及配置

my.ini 配置

官方下载:http://dev.mysql.com/downloads/mirrors/

复制 my-default.ini 为 my.ini

[mysqld]
explicit_defaults_for_timestamp = true
basedir = "D:/Server/MySQL/mysql-5.7.20-winx64"
datadir = "D:/Server/MySQL/mysql-5.7.20-winx64/data"
socket = "D:/Server/MySQL/mysql-5.7.20-winx64/tmp/mysql.sock"
port = 3306
character_set_server = utf8    # 设置MySQL服务器默认字符集(可选)
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

[client]
default_character_set = utf8    # 设置MySQL客户端默认字符集(可选)

初始化并安装服务

Install MySQL Service.bat

@echo off
set mysql_home=D:/Server/MySQL/mysql-5.7.20-winx64

echo Installing MySQL5.7 Service...
%mysql_home%/bin/mysqld --install "MySQL5.7" --defaults-file="%mysql_home%/my.ini"
%mysql_home%/bin/mysqld --initialize --user=mysql --console

pause

也可以单独执行mysqld –initialize初始化数据,注意记录默认生成的root用户密码

D:\Server\MySQL\mysql-5.7.20-winx64\bin>mysqld --initialize --user=mysql --console
2017-11-21T13:23:04.415538Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-11-21T13:23:04.460653Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-11-21T13:23:04.526828Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: a23b05a6-afed-11e6-869d-704d7b36dddd.
2017-11-21T13:23:04.528835Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-11-21T13:23:04.533849Z 1 [Note] A temporary password is generated for root@localhost: Hq?E7tajGi/e

启动服务

Start MySQL Service.bat

@echo off

echo Starting MySQL5.7 Service...
net start MySQL5.7

pause

停止和卸载服务

Stop MySQL Service.bat

@echo off

echo Stoping MySQL5.7 Service...
net stop MySQL5.7

pause

Uninstall MySQL Service.bat

@echo off
set mysql_home=D:/Server/MySQL/mysql-5.7.20-winx64

echo Uninstalling MySQL5.7 Service...
%mysql_home%/bin/mysqld.exe --remove "MySQL5.7"

pause

修改root用户密码

mysql> set password = password('ubuntu');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> alter user 'root'@'localhost' password expire never;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
上一篇 Docker查看、导入、导出、删除容器
下一篇 CentOS 7 下修改 MySQL 数据库存放位置