Q:MySQL管理工具与数据库服务器创建链接时,出现报错1251解决方案
php
A:缘由是MySQL8.0版本的加密方式和MySQL5.0的不同,链接会报错,所以要更改加密方式。html
PS C:\Windows\system32> mysql -uroot -p Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 18 Server version: 8.0.11 MySQL Community Server - GPL Copyright (c) 2000, 2018, 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> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; Query OK, 0 rows affected (0.10 sec)
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123'; Query OK, 0 rows affected (0.35 sec)
mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.28 sec)
Q:在数据库中建立表时,发现了一个新数据类型,varchar
A:varchar(m)是一种比char更加灵活的数据类型,一样用于表示字符数据,可是varchar能够保存可变长度的字符串。其中m表明该数据类型所容许保存的字符串的最大长度,只要长度小于该最大值的字符串均可以被保存在该数据类型中。java
Q:安装XAMPP又遇到了XAMPP Error: Apache shutdown unexpectedly
mysql
A:Apache服务使用的端口被占用了,Apache默认端口号80。git
所以我更改了Apache的端口:
spring
修改httpd.conf的Listen:80 为Listen:81(或其余):
sql
修改httpd-ssl.conf的Listen:443为Listen:4433(或其余):
数据库
重启Apache,就好啦服务器
Q:可是,启动Mysql启动失败,心态爆炸,我又处处去找解决办法,各类尝试,显示以下啊app
13:51:29 [mysql] Problem detected! 13:51:29 [mysql] Port 3306 in use by ""E:COMPUTERMysqlbinmysqld" --defaults-file="E:COMPUTERMysqlmy.ini" MySQL51"! 13:51:29 [mysql] MySQL WILL NOT start without the configured ports free! 13:51:29 [mysql] You need to uninstall/disable/reconfigure the blocking application 13:51:29 [mysql] or reconfigure MySQL and the Control Panel to listen on a different port 13:51:29 [mysql] Attempting to start MySQL app...
A:
[MySQL] mysql_port=3306
[ServicePorts] Apache=80 ApacheSSL=443 MySQL=3306
Q:改了端口问题,就变成Attempting to start service...这样的问题,总之仍是没法启动
A:后面才发现是我电脑上安装了mysql的软件,若是电脑已经安装了mysql的软件,要使用xampp的话,那么就要修改一下注册表。
win+r
打开命令行,输入regedit
修改注册表
按照HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL
我以前的是D:\MySQL\MySQL Server 8.0\bin\mysqld后面改为这个D:\XAMPP\mysql\bin\mysqld
改完以后就成功啦~
Q:没法链接phpMyAdmin,出现以下错误
A:是由于我以前更改过密码,这时候经过wampserver访问phpmyadmin会发现没法访问,没有权限,须要输入密码
打开D:\XAMPP\phpMyAdmin,找到config.inc.php文件,将$cfg['Servers'][$i]['user'] = 'root'
在password对应的后面写上以前设置的密码,而后就能够登陆phpmyadmin了!^_^
Q:IDEA链接数据库时,出现了以下问题
A:
异常是Loading class 'com.mysql.jdbc.Driver'.This is deprecated.The new driver class is com.mysql.cj.jdbc.Driver.
整合spring boot项目过程当中出现的,用了最新的mysql 链接驱动
只需将com.mysql.jdbc.Driver
改成com.mysql.cj.jdbc.Driver
异常是Exception in thread "main" java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
使用的是MySQL 8.0版本的时候出现的问题错误,须要在访问数据库的Url后面加上如下的语句便可:?serverTimezone=GMT%2B8