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