|
1. 安装了MySql 8,想用SqlYog远程连接,中途遇到问题,最终不仅重新安装了实例,还要保重如下:
用户(我用的root)host为%且plugin为mysql_native_password.
2.存储Json
https://www.cnblogs.com/Soy-technology/p/11050118.html
----
my.ini的位置
- C:\ProgramData\MySQL\MySQL Server 8.0
复制代码
查看是否安装成功:C:\Users\Administrator>mysqld -install
Service successfully installed.
启动MySql:
C:\Users\Administrator>net start mysql
MySQL 服务正在启动 .
MySQL 服务无法启动。
C:\Program Files\MySQL\MySQL Server 8.0\data 报错
2019-08-12T11:57:34.282069Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld (mysqld 8.0.17) starting as process 2824
2019-08-12T11:57:34.454669Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2019-08-12T11:57:34.455573Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-08-12T11:57:34.464049Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-08-12T11:57:34.466151Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.17) MySQL Community Server - GPL.
参考文章:https://blog.csdn.net/github_38832708/article/details/83037241
移除MySQL服务:- C:\Users\Administrator>mysqld -remove MySQL
- Service successfully removed.
复制代码 重新安装mysql服务:
- C:\Users\Administrator>mysqld -remove MySQL
- Service successfully removed.
- C:\Users\Administrator>mysqld --initialize-insecure
- C:\Users\Administrator>mysqld --install
- Service successfully installed.
- C:\Users\Administrator>net start mysql
- MySQL 服务正在启动 ..
- MySQL 服务已经启动成功。
- C:\Users\Administrator>
复制代码- mysql> show databases
- -> ;
- +--------------------+
- | Database |
- +--------------------+
- | information_schema |
- | mysql |
- | performance_schema |
- | sys |
- +--------------------+
- 4 rows in set (0.01 sec)
- mysql> select host,user,plugin from user;
- ERROR 1046 (3D000): No database selected
- mysql> use mysql
- Database changed
- mysql> select host,user,plugin from user;
- +-----------+------------------+-----------------------+
- | host | user | plugin |
- +-----------+------------------+-----------------------+
- | localhost | mysql.infoschema | caching_sha2_password |
- | localhost | mysql.session | caching_sha2_password |
- | localhost | mysql.sys | caching_sha2_password |
- | localhost | root | caching_sha2_password |
- +-----------+------------------+-----------------------+
- 4 rows in set (0.00 sec)
- mysql> alter user 'root'@'localhost' identified with mysql_native_password by '0314';
- Query OK, 0 rows affected (0.03 sec)
- mysql> flush privileges;
- Query OK, 0 rows affected (0.02 sec)
- mysql> select host,user,plugin from user;
- +-----------+------------------+-----------------------+
- | host | user | plugin |
- +-----------+------------------+-----------------------+
- | localhost | mysql.infoschema | caching_sha2_password |
- | localhost | mysql.session | caching_sha2_password |
- | localhost | mysql.sys | caching_sha2_password |
- | localhost | root | mysql_native_password |
- +-----------+------------------+-----------------------+
复制代码 进入数据库 ,将root的用户的host 属性 设置为%- mysql> use mysql
- Database changed
- mysql> update user set host='%' where user = 'root';
- Query OK, 1 row affected (0.06 sec)
- Rows matched: 1 Changed: 1 Warnings: 0
- mysql> flush privileges;
- Query OK, 0 rows affected (0.02 sec)
- mysql>
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|