mysql數據庫安裝及使用常見錯誤


1、Found option without preceding group in config file

D:\mysql-8.0.17\bin>mysqld --initialize --console

mysqld: [ERROR] Found option without preceding group in config file D:\mysql-8.0.17\my.ini at line 1.
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

原因:my.ini文件格式是utf-8

解決辦法:my.ini文件保存為ANSI格式文件

 

2、Install/Remove of the Service Denied!

解決辦法:打開cmd.exe程序的時候選擇“用管理員身份打開”。

 

3、MySQL8.0,Navicat連接不上,報錯1251

原因是MySQL8.0版本的加密方式和MySQL5.0的不一樣,連接會報錯。

解決方法

 

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> use mysql;
Database changed


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 'password';
Query OK, 0 rows affected (0.35 sec)


mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.28 sec)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM