Mysql的入门和连接问题

Mysql的连接问题

最近学完了mysql的基础语法,基本上是掌握了mysql的简单运用。

1、入门mysql

我是通过看《漫画sql》入门的,这个视频案例很到位,跟着2倍速学前9章就可以实操了。

这里分享出来链接:https://pan.baidu.com/s/1qGCc4M3RieYbzr_cBP2jPw
提取码:ep7q

2、设计工具

mysql 这个直接在官网上下载,跟着网上配置一下即可。

SQLyog一个图形用户界面,观察起来更直观。

IDEA编译器,可以连接你的mysql,在后面要讲一下。

3、IDEA连接数据库遇到的问题

首先打开IDEA-View-toolsWindow-datebase就可以连接了。

输入你的User 和 Password即可

but!!!在Test Connection时报错了

① Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property manually.

翻译一下:服务器返回无效时区。转到“高级”选项卡并手动设置“serverTimezone”属性。

解决:

mysql -u root -p

这里需要输入你的密码

mysql>show variables like '%time_zone%';

mysql>set global time_zone='+8:00';

还有一个错误是在网上看到的,这里也写下来:

② The specified user/password combination is rejected:

[HY000][1862] Your password has expired.
To log in you must change it using a client that supports expired passwords.

原因:原因是:

MySQL 5.7.16 introduces password-expiration capability, to enable database administrators to expire account passwords and require users to reset their password.
解决:

mysql -u root -p

这里需要输入你的密码

SET PASSWORD = PASSWORD('root');

4、成功导入

效果图如下:

成功,yeah!

原文地址:https://www.cnblogs.com/wangzheming35/p/11975086.html