mysql遇到的问题

1、在jdbc.properties中

username=(自己的mysql用户名)
password=(自己的mysql密码)
url=jdbc:mysql://localhost:3306/book?characterEncoding=utf8&useSSL=false
driverClassName=com.mysql.jdbc.Driver
initialSize=5
maxActive=1

MySQL 8.0 以上版本不需要建立 SSL 连接的,需要显式关闭。

  MySQL 5.7 之前版本,安全性做的并不够好,比如安装时生成的root空密码账号、存在任何用户都能连接上的 test 库等,导致数据库存在较大的安全隐患。从5.7版本开始MySQL官方对这些问题逐步进行了修复,到了 MySQL 8.0 以上版本已经不需要使用 SSL 进行连接加密了。但是高版本仍然保留了这个接口,所以需要在连接的时候手动写明是否需要进行 SSL 连接,这里我们手动关闭 SSL 连接加密就OK。

  useSSL=false

2、C:\Windows\system32>mysql -u root -p
Enter password: ****
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

解决方法:

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --install

切换到mysql安装目录下的bin文件夹,命令行运行"mysqld --install"

此时使用“net start mysql”成功启动msyql,一般就可以正常启动mysql了

C:\Program Files\MySQL\MySQL Server 8.0\bin>net start mysql
MYSQL 服务正在启动 ..
MYSQL 服务已经启动成功。


C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.18 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

mysql无法正常启动

可以去计算机管理里面查看mysql是否已经开启

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小夏天禧

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值